I'm finally getting my robot's software off the ground!:) (Although I'm giving my "artificial learning" program a rest for later).
However, here's something I've been wondering how to do for quite some time now.
I'm using the time module to allow my robot to tell me the time upon vocal command. However, when my robot replies, the reply sounds something like this, "The time is currently Monday September eight 12 colon 46 colon 30 colon 2008." My robot vocalizes the "colon" in the time "12:46:30." So I tried to replace all colons with string.replace, like so:
import speech
import random
import sys, time, math, string
string = string.replace(":", " ")
TimeStr = [ "The time is currently " + time.asctime(), "Right now its " + time.asctime(), "It's " + time.asctime(), time.asctime() ]
if phrase == "whats the time":
speech.say(random.choice(TimeStr))
but that gave an exception saying replace takes at least 3 arguments (2 given).
So after looking up help(replace) in the command line, I found out I had to list the string, so I rewrote the code like this:
import speech
import sys, time, math, string
string = string.replace(time.asctime(),":", " ")
TimeStr = [ "The time is currently " + time.asctime(), "Right now its " + time.asctime(), "It's " + time.asctime(), time.asctime() ]
if phrase == "whats the time":
speech.say(random.choice(TimeStr))
After that the program runs, but my robot is still vocalizing the "colon" in time.asctime()!
I'm not sure where to go from here...