Skip to content

Instantly share code, notes, and snippets.

@RichardScottOZ
Created March 3, 2024 05:21
Show Gist options
  • Save RichardScottOZ/8495dd4267a8f5deaa0e591f7165f495 to your computer and use it in GitHub Desktop.
Save RichardScottOZ/8495dd4267a8f5deaa0e591f7165f495 to your computer and use it in GitHub Desktop.
Timer Noise Fozzie version
import time
from IPython.display import Audio, display
def allDone():
display(Audio(url='http://blogfiles.wfmu.org/SW/waka_waka.mp3', autoplay=True))
allDone()
def countdown(t):
while t:
mins, secs = divmod(t, 60)
hours, mins = divmod(mins, 60) # divide number of minutes by 60 to get hours
days, hours = divmod(hours, 24) # divide number of hours by 24 to get days
timer = '{:02d}:{:02d}:{:02d}:{:02d}'.format(days, hours, mins, secs)
print(timer, end="\r")
time.sleep(1)
t -= 1
print('Exploracorn!!')
t = 10
countdown(int(t))
allDone()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment