0
我正在學習Python,並且正在修改高級調度程序。雖然我無法使用它。APScheduler沒有執行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小時運行一次。 謝謝