kac/client.py

15 lines
384 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://10.1.1.100:8000/upload'
file = {'file': open(change[1], 'rb')}
resp = requests.post(url=url, files=file)
if __name__ == "__main__":
main()