Created
August 29, 2021 17:24
-
-
Save pratik-choudhari/264d5b90605f2d4f4cad2e1038d80e51 to your computer and use it in GitHub Desktop.
schedule library
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
| import schedule | |
| import time | |
| def task(): | |
| print("Job Executing!") | |
| # for every n minutes | |
| schedule.every(10).minutes.do(task) | |
| # every hour | |
| schedule.every().hour.do(task) | |
| # every daya at specific time | |
| schedule.every().day.at("10:30").do(task) | |
| # schedule by name of day | |
| schedule.every().monday.do(task) | |
| # name of day with time | |
| schedule.every().wednesday.at("13:15").do(task) | |
| while True: | |
| schedule.run_pending() | |
| time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment