python定时任务实现

mac2022-06-30  23

安装

pip install 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) schedule.every().minute.at(":17").do(job) while True: schedule.run_pending() time.sleep(1)

转载于:https://www.cnblogs.com/c-x-a/p/11363692.html

相关资源:python基于celery实现异步任务周期任务定时任务
最新回复(0)