Skip to content

Commit

Permalink
Update main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
arnavnagpurkar authored Apr 20, 2023
1 parent b85bcb0 commit 1ae8a99
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand All @@ -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

0 comments on commit 1ae8a99

Please sign in to comment.