0

I made a Python script to remind me to drink water every hour. My code is:

import time
import plyer
from plyer import notification

if __name__ == "__main__":
    while True:
        plyer.notification.notify(
            title="Go and Drink Water!",
            message="You need to drink at least 3.5 litres of water Everyday. Being Dehydrated can decrease Brain Function and Energy levels.",
            app_icon="C:\\Users\\(My username)\\(location of icon)",
            timeout=10,
        )
        time.sleep(60 * 60)

I put the python path and this script's path in a .bat file and made it run everyday at 8:35am using Task Scheduler. It did run at 8:35am but it didn't repeat. Can anyone point out what I am doing wrong or suggest a better method?

TylerH
  • 20,799
  • 66
  • 75
  • 101
Wolfickle
  • 1
  • 1

1 Answers1

0

use python APScheduler module: https://apscheduler.readthedocs.io/en/stable/userguide.html#code-examples

parthiban
  • 133
  • 1
  • 16