【发布时间】:2017-06-05 09:02:52
【问题描述】:
我已安排我的函数在每天的特定时间运行。
我将一个参数传递给它,函数返回一个值,我需要在我的代码中使用该值进行进一步计算。
如何捕捉它?
代码sn-p:
import schedule as sd
import time
def dothis(h):
h-=1
print("Hour left : "+str(h))
return(h)
h=24
d="14:00"
sd.every().day.at(d).do(dothis,h) # how to catch the value here?
while True:
sd.run_pending()
time.sleep(1)
【问题讨论】: