Skip to content

Instantly share code, notes, and snippets.

@sburns
Created September 26, 2012 13:42
Show Gist options
  • Save sburns/3788119 to your computer and use it in GitHub Desktop.
Save sburns/3788119 to your computer and use it in GitHub Desktop.
APScheduler demo
from apscheduler.scheduler import Scheduler
from my_module import do_work_often, do_some_more_work
sched = Scheduler()
@sched.interval_schedule(hours=1)
def first_job():
do_work_often()
@sched.cron_schedule(day_of_week='mon-sun', hour=1)
def second_job():
do_some_more_work()
sched.start()
while True:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment