Skip to content

Instantly share code, notes, and snippets.

@konsumer
Created June 17, 2019 19:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save konsumer/8980c30e91a7e9ab8fbddb9f9367820c to your computer and use it in GitHub Desktop.
Save konsumer/8980c30e91a7e9ab8fbddb9f9367820c to your computer and use it in GitHub Desktop.
while True:
t = time.localtime()
print('%2d:%2d:%2d' % (t[3], t[4], t[5])) # print out the time
minute = t[4]
if minute == 0:
hour = t[3]
ampmhour = hour % 12
playcuckoo(ampmhour)
time.sleep(60) # sleep a minute to keep this from triggering again this hour
time.sleep(1) # sleep 1 second to make it not run at 100% in this loop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment