Created
August 30, 2012 08:54
-
-
Save KitWallace/3524453 to your computer and use it in GitHub Desktop.
The talking clock can be switched on or off via a persistant switch object
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/python | |
import time | |
import speak | |
from persistant import * | |
from switch import * | |
Switch("clock").put() | |
while True : | |
sw = get("clock") | |
if sw.on : | |
message = "The Raspberry Pi time is " + \ | |
speak.escape_XML(speak.ssml_break(500)) + \ | |
str(int(time.strftime('%I'))) + \ | |
' ' + time.strftime('%M %p') | |
speak.say(message) | |
time.sleep(60) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment