kac/client.py

15 lines
383 B
Python

from watchgod import watch
from printer import printer
import requests
base = "./"
def main():
for changes in watch('./images'):
print(changes)
for change in changes:
url = 'http://127.0.0.1:8000/upload'
file = {'file': open(change[1], 'rb')}
resp = requests.post(url=url, files=file)
if __name__ == "__main__":
main()