Skip to content

Instantly share code, notes, and snippets.

@KitWallace
Created August 30, 2012 08:54
Show Gist options
  • Save KitWallace/3524453 to your computer and use it in GitHub Desktop.
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
#!/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