Sound every hour

 Using the previous two program's components, I made a program that gives me a notification every hour that also tells me what time it is. This will give me an idea of how much time is passing. I'll have this open in a cmd window.

from datetime import datetime
import win10toast

toast = win10toast.ToastNotifier()
while True:
time = datetime.now().strftime("%M:%S")
hour = datetime.now().strftime("%H")
if int(hour) > 12:
hour = str(int(hour) - 12)
if time == "00:00":
toast.show_toast("Hourly notification", "The time is " + hour + ":00")

Comments