python apscheduler
# coding=utf-8from 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]