I am programming a online Expression Calculator in GAE using Python. I am using query string to get the query and then evaluate the expression. For example for ishamsample.appspot.com/eval?q=9-6
browser should show {9-3}{6}
This like query is working properly but the problem is + symbol. ishamsample.appspot.com/eval?q=1+6
Below is my code. I tried URL quoting
class Eval(webapp2.RequestHandler):
def get(self):
q=self.request.get('q')
q=urllib.quote(q)
code=eval(compile(q,'<string>', 'eval', __future__.division.compiler_flag))
self.response.write('{'+q+'}{'+str(code)+'}')
For that browser shows output as {1%206}{1}
How to overcome this issue.