Skip to content

Instantly share code, notes, and snippets.

@Code-Egg
Created November 10, 2019 12:49
Show Gist options
  • Save Code-Egg/5cb0d389fb5e0cdccb2819b524a8827d to your computer and use it in GitHub Desktop.
Save Code-Egg/5cb0d389fb5e0cdccb2819b524a8827d to your computer and use it in GitHub Desktop.
from threading import Thread
import threading
_eat_record_loop={} #loop
def food_loop(): #loop
the_thread = threading.currentThread()
while getattr(the_thread, "do_run", True):
sleep(60)
now_time = datetime.datetime.now().strftime("%H:%M")
print("now_time:",now_time)
if now_time == '22:59':
print("send_food_photo")
for user_id in _eat_record_loop.keys():
sleep(1)
_Push_LINE_server(_push_food_payload(user_id))
else:
continue
print('end_while')
the_thread = Thread(target=food_loop, args=())
the_thread.start()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment