1
在Python中使用计划包时,我想要安排任务在特定时间启动,然后每10秒运行一次。我能够使用schedule.every(10).seconds.do(x)
每10秒运行一次任务,并且我还使用schedule.every().day.at('13:25').do(x)
在设定的时间运行了该任务。但是我怎么把这些放在一起呢?我试图将它们组合成以下,但我得到了RecursionError: maximum recursion depth exceeded
计划任务在特定时间开始每n秒运行
import schedule
import time
def test():
print('Hello, World!')
def sched_job():
schedule.every(10).seconds.do(test)
while True:
schedule.run_pending()
time.sleep(1)
schedule.every().day.at('13:56').do(sched_job)
while True:
schedule.run_pending()
time.sleep(1)
sched_job()
的(http://stackoverflow.com/questions/26774186/looping-at-a [以恒定速率以高精度对信号采样循环]可能的复制的常数 - 率 - 用高精度换信号采样) –