📜  apscheduler BlockingScheduler cron 和间隔样本 - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:03.850000             🧑  作者: Mango

代码示例1
from apscheduler.schedulers.blocking import BlockingScheduler

sched = BlockingScheduler()

@sched.scheduled_job('interval', minutes=3)
def timed_job():
    print('This job is run every three minutes.')

@sched.scheduled_job('cron', day_of_week='mon-fri', hour=17)
def scheduled_job():
    print('This job is run every weekday at 5pm.')

sched.start()