I am a PHP developer and I used to get query string using $_SERVER['QUERY_STRING'] in PHP.
What is the Python 2.7 syntax for this?
import web
import speech_recognition as sr
from os import path
urls = (
'/voice', 'Voice'
)
app = web.application(urls, globals())
class Voice:
def GET(self):
WAV_FILE = path.join(path.dirname(path.realpath("C:\Python27")),'wavfile.wav')
r = sr.Recognizer()
with sr.WavFile("C:\Python27\wavfile.wav") as source:
audio = r.record(source) # read the entire WAV file
output = r.recognize_google(audio)
return output
if __name__ == "__main__":
app.run()
web.py?import web(which isn't in the Python 2 standard library) and the sameurls/app = web.application(urls, globals())structure from theweb.pytutorial. If your code really looks like this I'm fairly confident that it usesweb.py.