Add client

This commit is contained in:
jimmy 2022-11-05 00:40:46 +13:00
parent 4a17e2feb9
commit 9e98336d10
1 changed files with 15 additions and 0 deletions

15
client.py Normal file
View File

@ -0,0 +1,15 @@
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()