python任务调度轻量级框架

来源:互联网 发布:java utf8转换为gbk 编辑:程序博客网 时间:2024/05/22 05:15

#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

原创粉丝点击