Ejemplo n.º 1
0
 def do_POST(self):
     if self.path.startswith('/voice'):
          voice = Voice()   
          phrase = self.path.replace('/voice/','').replace('%20',' ')
          print phrase
          voice.spell(' '+phrase)
     self.path = '/webapp/index.html'
     return SimpleHTTPServer.SimpleHTTPRequestHandler.do_GET(self)
Ejemplo n.º 2
0
Archivo: voice.py Proyecto: ammous/myPI
def main(argv):
    stringText = ''
    try:
        opts, args = getopt.getopt(argv, "hs:t:", ["s=", "time="])
    except getopt.GetoptError:
        print 'voice.py -s <stringText> -t'
        sys.exit(2)
    for opt, arg in opts:
        if opt == '-s':
            voice = Voice()
            voice.spell(stringText)
            sys.exit()
        elif opt in ("-t", "--time"):
            voice = Voice()
            voice.time()
            sys.exit()
Ejemplo n.º 3
0
def main(argv):
   stringText = ''
   try:
      opts, args = getopt.getopt(argv,"hs:t:",["s=","time="])
   except getopt.GetoptError:
      print 'voice.py -s <stringText> -t'
      sys.exit(2)
   for opt, arg in opts:
      if opt == '-s':
          voice = Voice()
          voice.spell(stringText)
          sys.exit()
      elif opt in ("-t", "--time"):
          voice = Voice()
          voice.time()
          sys.exit()