Yes, it is pretty simple. You could do something like this:
import schedule
import time
import datetime
def func():
print("Working now")
print(datetime.datetime.now())
schedule.every().day.at("15:50:15").do(func)
while True:
schedule.run_pending()
time.sleep(1)
Your func
will be executed each day at 15:50:15
, where the last number of course indicates the seconds. You can verify it with the second print inside func
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…