Created
July 30, 2010 13:19
-
-
Save nb/500499 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
#!/usr/bin/env python | |
import os | |
import sys | |
import time | |
import random | |
messages = { | |
0: "It is Midnight! And that's all", | |
1: "It's 1 o'clock and the weather outside is fine. Do you wanna go out for a walk?", | |
6: "A third of the number of the beast o'clock", | |
} | |
generics = [ | |
"Let's get back to bed boy! %d o'clock already", | |
"%d hours. Oh, how I hate saying hours", | |
"It's %d o'clock and I am a stupid laptop", | |
"I am a stupid stupid laptop at %d o'clock", | |
"It is %d o'clock", | |
"Get off me, it's already %d o'clock. Go find another toy", | |
"Such a shock, it's %d o'clock", | |
] | |
hour = time.localtime().tm_hour if len(sys.argv) < 2 else int(sys.argv[1]) | |
small_hour = hour if hour <= 12 else hour - 12 | |
os.system('say %s' % messages.get(hour, random.choice(generics) % small_hour).replace("'", "\\'")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've heard that one a few times