Created
June 17, 2019 19:29
-
-
Save konsumer/8980c30e91a7e9ab8fbddb9f9367820c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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