标签:
from apscheduler.scheduler import Scheduler
import datetime
# Start the scheduler
sched = Scheduler()
def job_function():
print "Hello World" , ‘start job1 at: ‘, datetime.datetime.now()
def job_f():
print "Hello World" , ‘start job2 at: ‘, datetime.datetime.now()
print ‘start to sleep‘
print ‘wake‘
print datetime.datetime.now()
sched.daemonic = False
sched.add_cron_job(job_function,day_of_week=‘5‘, hour=‘19‘, minute=‘1‘,second=‘1‘)
sched.add_cron_job(job_f,day_of_week=‘5‘, hour=‘20‘, minute=‘1‘,second=‘1‘)
sched.start()
标签:
原文地址:http://www.cnblogs.com/highroom/p/2ea093ac7e11a8142de9da3f9147c7f2.html