Created
September 4, 2017 15:45
-
-
Save Code-Egg/59c2ae372929bf0f6c672c86ab7ad5c3 to your computer and use it in GitHub Desktop.
line5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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