pythonnotificationsschedulereminders

how to make a program remind me in a specific time everyday in python?


I tried to make a program that reminds me of a specific time everyday with a notification, there is no errors, but the code doesn't work and I really don't know how to solve this. This is the code:

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)

Solution

  • Take a look at the docs, you using the package wrong:

    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)