Skip to content

Instantly share code, notes, and snippets.

@pratik-choudhari
Created August 29, 2021 17:24
Show Gist options
  • Select an option

  • Save pratik-choudhari/264d5b90605f2d4f4cad2e1038d80e51 to your computer and use it in GitHub Desktop.

Select an option

Save pratik-choudhari/264d5b90605f2d4f4cad2e1038d80e51 to your computer and use it in GitHub Desktop.
schedule library
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