Example #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)
Example #2
0
File: voice.py Project: 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()
Example #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()