【发布时间】:2014-04-02 04:31:22
【问题描述】:
我正在学习 Python,并且正在修改高级调度程序。我无法让它工作。
import time
from datetime import datetime
from apscheduler.scheduler import Scheduler
sched = Scheduler(standalone=True)
sched.start()
#@sched.cron_schedule(second=5)
def s():
print "hi"
sched.add_interval_job(s, seconds=10)
i=0
while True:
print i
i=i+1
time.sleep(3)
sched.shutdown()
我确定我缺少一些基本的东西。有人能指出来吗?
您还会向高级调度程序推荐一个 crontab 吗?我希望我的脚本每 24 小时运行一次。 谢谢
【问题讨论】:
标签: python crontab apscheduler