예제 #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)
예제 #2
0
파일: voice.py 프로젝트: sguernion/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()
예제 #3
0
파일: voice.py 프로젝트: 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()