Last active
October 21, 2017 21:15
-
-
Save code247/99ed27f22acaf6493172b3365f508a4f to your computer and use it in GitHub Desktop.
APScheduler example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from apscheduler.schedulers.blocking import BlockingScheduler | |
from helper import your_function_a, your_function_b | |
sched = BlockingScheduler() | |
@sched.scheduled_job('interval', minutes='30') | |
def print_data(): | |
print("Have a good day!") | |
@sched.scheduled_job('cron', day_of_week='sat-sun', hour='8-14', minute='0-59/10', timezone='America/New_York') | |
def update_a(): | |
your_function_a() | |
@sched.scheduled_job('cron', day_of_week='fri', hour='15-19/2', timezone='America/New_York') | |
def update_b(): | |
your_function_b() | |
sched.start() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment