I'm trying to make a countdown timer like little script. I want it to look like this:
0 years left until your event.
0 months left until your event.
10 days left until your event.
234 hours left until your event.
14020 minutes left until your event.
841166 seconds left until your event.
As you can see it's not a "normal" countdown. I want it to be like this, total amount of seconds, total amount of minutes left etc. Now I'm running into trouble trying to make it actually count-down. Just the seconds are working fine, I'm using this piece of code for that:
def secondsLeft(eventDate):
while secondsUntil:
toPrint = "%s seconds left until your event." %(secondsUntil)
print(toPrint, end='\r')
time.sleep(1)
secondsUntil -= 1
However, when trying to do the same for the minutes, replacing with time.sleep(60) it's not printing out the seconds anymore!
I think it has to do with the while loop. However, I don't know what to do about it... Any help in the right direction is appreciated!!