Created
June 22, 2020 15:18
-
-
Save sylhare/dad7ed1ef3d13614c77c4ebadf8a11c3 to your computer and use it in GitHub Desktop.
type-on-strap-gist
This file contains hidden or 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
#!/usr/bin/env python3 | |
""" https://wiki.python.org/moin/SimplePrograms """ | |
from time import localtime | |
activities = {8: 'Sleeping', 9: 'Commuting', | |
17: 'Working', 18: 'Commuting', | |
20: 'Eating', 22: 'Resting' } | |
time_now = localtime() | |
hour = time_now.tm_hour | |
for activity_time in sorted(activities.keys()): | |
if hour < activity_time: | |
print (activities[activity_time]) | |
break | |
else: | |
print ('Unknown, AFK or sleeping!') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment