Python任务调度框架 APScheduler简介

#python任务调度轻量级框架

from apscheduler.scheduler import Scheduler
import time

# Start the scheduler
sched = Scheduler()


def job_function():
    print "Hello World"

print 'start to sleep'
sched.daemonic = False
sched.add_cron_job(job_function,day_of_week='mon-sun', hour='*', minute='0-59',second='*/5')
sched.start()
#下载包:http://pypi.python.org/pypi/APScheduler/

#参考:http://packages.python.org/APScheduler/index.html

猜你喜欢

转载自dacoolbaby.iteye.com/blog/1975181