Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import espeak
- from time import gmtime, strftime
- es = espeak.ESpeak()
- while True:
- get_time = raw_input('press enter to hear time')
- curtime=strftime("%H:%M", gmtime())
- hour = int(curtime[:2])
- min = int(curtime[3:])
- if hour >12:
- hour -= 12
- denote = "pm"
- else:
- denote = "am"
- sayTime = str(hour)+":" +str(min)+" "+denote
- print(sayTime)
- es.say(sayTime)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement