Created
June 22, 2020 15:18
-
-
Save sylhare/dad7ed1ef3d13614c77c4ebadf8a11c3 to your computer and use it in GitHub Desktop.
Revisions
-
sylhare created this gist
Jun 22, 2020 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ #!/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!')