萨尔法保护 发表于 2017-4-26 10:28:13

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
页: [1]
查看完整版本: Python任务调度框架 APScheduler简介