Created
May 1, 2014 22:37
-
-
Save nikolak/d0de5edd78b9e57412bc 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
import datetime | |
import time | |
alarm = datetime.datetime(2014, month, day, hour, minute) | |
while True: | |
now = datetime.datetime.now() | |
diff = alarm - now | |
if diff.total_seconds() < 0: | |
print "Alarm triggered" | |
break | |
else: | |
print "{} seconds left to alarm".format(diff.total_seconds()) | |
time.sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment