【发布时间】:2015-11-11 20:51:32
【问题描述】:
我正在尝试安排一些工作,感谢 stackoverflow,我能够找到 Schedule (https://pypi.python.org/pypi/schedule)。
不幸的是,这并没有很好地记录下来。我有一个我正在尝试运行的作业列表,每个作业都在一天中的特定时间运行。
for i in jobArray:
# compareTimes returns a boolean that indicates if it's time to run it, assume it works.
if compareTimes(i.time):
# I want to schedule this job for a specific time, i.time
schedule.every().day.do(job)
while 1:
schedule.run_pending()
time.sleep(60)
这就是我想出的。显然这是错误的(它卡在 while 循环中)。 .run_pending() 没有文档,所以我不知道如何修复它以使其正常工作。请帮忙。
谢谢。
【问题讨论】: