我目前正在编写一个Python 程序,该程序应该启动多个任务。为了进行时间管理,我安装了 Schedule 库。不幸的是,调度程序每次都会执行我的函数,尽管它没有正确的时间。无论时间是过去还是将来,该函数总是会被执行。
import time
from datetime import date
import schedule
class trader():
def __init__(self):
pass
def scheduler(self, x, y, z):
#schedule.every().monday.at("23:10").tag().do(self.daily(x, y, z))
schedule.every().day.at("22:10").do(self.daily(x, y, z))
while True:
schedule.run_pending()
time.sleep(1)
def daily(self, x, y, z):
print("running")
return
感谢您的帮助
繁华开满天机
相关分类