Skip to content

Instantly share code, notes, and snippets.

@b1tg
Created June 10, 2018 16:08
Show Gist options
  • Save b1tg/0caeced610bc3ae2c8a80a7fb708e900 to your computer and use it in GitHub Desktop.
Save b1tg/0caeced610bc3ae2c8a80a7fb708e900 to your computer and use it in GitHub Desktop.
[定时调用] schedule库
import schedule
import time
def job():
print("I'm working...")
schedule.every(10).minutes.do(job)
schedule.every().hour.do(job)
schedule.every().day.at("10:30").do(job)
schedule.every().monday.do(job)
schedule.every().wednesday.at("13:15").do(job)
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