Here is my goal: To make a small program (text based) that will start with a greeting, print out a timer for how long it has been since the last event, and then a timer for the
a simple timer program that has sound to remind you would be:
from time import sleep
import winsound
m = 0
print("""**************************
Welcome To FASTIMER®
**************************""")
while True:
try:
countdown = int(input("How many seconds: "))
break
except ValueError:
print("ERROR, TRY AGAIN")
original = countdown
while countdown >= 60:
countdown -= 60
m += 1
for i in range (original,0,-1):
if m < 0:
break
for i in range(countdown,-2,-1):
if i % 60 == 0:
m-=1
if i == 0:
break
print(m," minutes and ",i," seconds")
sleep(1)
if m < 0:
break
for j in range(59,-1,-1):
if j % 60 == 0:
m-=1
print(m," minutes and ",j," seconds")
sleep(1)
print("TIMER FINISHED")
winsound.PlaySound('sound.wav', winsound.SND_FILENAME)
this program uses time.sleep() to wait a second. It converts every 60 seconds to a minute. the sound only works with Windows or you can install pygame to add sounds.