沈阳格力专卖店 发表于 2017-4-21 06:58:24

python apscheduler

# coding=utf-8
from apscheduler.scheduler import Scheduler
import time,datetime
def job_function():
print "Hello World"
if __name__ == '__main__':
sched = Scheduler()
sched.daemonic = False
sched.add_cron_job(job_function,day_of_week='*', hour='*', minute='0-59',second='*/5')
sched.start()
lastDate = datetime.date.today() - datetime.timedelta(days=1)
print lastDate.strftime('%Y%m%d')
页: [1]
查看完整版本: python apscheduler