From 1ae8a9994c2dd1469bad936269862a3dd0264fb7 Mon Sep 17 00:00:00 2001 From: Arnav Nagpurkar <84492896+ArnavNagpurkar@users.noreply.github.com> Date: Thu, 20 Apr 2023 21:50:07 +0530 Subject: [PATCH] Update main.py --- main.py | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/main.py b/main.py index 5d2105d..fa2280c 100644 --- a/main.py +++ b/main.py @@ -11,14 +11,27 @@ name = input("Enter your name: ") name = name.title() -# How many times to display the notification? -howMany = int(input("How many times would I remind you to drink water? ")) - # After how many minutes to display the notification? notificationTime = int(input(f"In how many min(s) would you like me to remind you to drink water? ")) -# Final Program to Loop -for i in range(howMany): +# # How many times to display the notification? (Uncomment for using for loop and comment for using while loop) +# howMany = int(input("How many times would I remind you to drink water? ")) + + +# # Final Program to Loop + +# for i in range(howMany): +# # Loading the current timeCurrent time +# currentTime = datetime.datetime.now() +# timeNow = currentTime.strftime("%H:%M:%S") +# +# # Displaying the notification +# toaster.show_toast(f"Drink Water", f"Drink Water {name} its {timeNow}!", duration=10) +# # Waiting for the given time and again displaying notification +# time.sleep(notificationTime * 60) +# --------------------------OR--------------------------------- + +while True: # Loading the current timeCurrent time currentTime = datetime.datetime.now() timeNow = currentTime.strftime("%H:%M:%S") @@ -27,3 +40,5 @@ toaster.show_toast(f"Drink Water", f"Drink Water {name} its {timeNow}!", duration=10) # Waiting for the given time and again displaying notification time.sleep(notificationTime * 60) + +# Either use for loop or use while loop for the program