Answers for "apscheduler BlockingScheduler cron and interval samples"

0

apscheduler BlockingScheduler cron and interval samples

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()
Posted by: Guest on January-06-2022

Browse Popular Code Answers by Language