我试图制作一个程序,通过通知提醒我每天的特定时间,没有错误,但代码不起作用,我真的不知道如何解决这个问题。这是代码:
import schedule
from plyer import notification
def send_notification():
notification.notify(
title = "Take A Break!!!",
timeout = 10
)
while True:
schedule.every().day.at("07:00").do(send_notification)
看看文档,你用错了包:
import schedule
import time
from plyer import notification
def send_notification():
notification.notify(
title = "Take A Break!!!",
timeout = 10
)
schedule.every().day.at("07:00").do(send_notification)
while True:
schedule.run_pending()
time.sleep(1)