kac/client.py

15 lines
384 B
Python
Raw Normal View History

2022-11-04 11:40:46 +00:00
from watchgod import watch
from printer import printer
import requests
base = "./"
def main():
for changes in watch('./images'):
print(changes)
for change in changes:
2022-11-04 12:22:23 +00:00
url = 'http://10.1.1.100:8000/upload'
2022-11-04 11:40:46 +00:00
file = {'file': open(change[1], 'rb')}
resp = requests.post(url=url, files=file)
if __name__ == "__main__":
main()