Skip to content

Instantly share code, notes, and snippets.

@Code-Egg
Created September 4, 2017 15:45
Show Gist options
  • Select an option

  • Save Code-Egg/59c2ae372929bf0f6c672c86ab7ad5c3 to your computer and use it in GitHub Desktop.

Select an option

Save Code-Egg/59c2ae372929bf0f6c672c86ab7ad5c3 to your computer and use it in GitHub Desktop.
line5
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