Skip to content

Instantly share code, notes, and snippets.

@nb
Created July 30, 2010 13:19
Show Gist options
  • Save nb/500499 to your computer and use it in GitHub Desktop.
Save nb/500499 to your computer and use it in GitHub Desktop.
#!/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("'", "\\'"))
@skanev
Copy link

skanev commented Jul 30, 2010

I've heard that one a few times

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment