I just started out with Python and wanted to try out tornado.
Running the example from tornado website
import sys
sys.path.append(r'C:\Python32\tornado-2.3')
import tornado.ioloop
import tornado.web
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("Hello, world")
application = tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
application.listen(8888)
tornado.ioloop.IOLoop.instance().start()
I got the following error:
File "C:\Python32\tornado-2.3\tornado\ioloop.py", line 302
except Exception, e:
^
SyntaxError: invalid syntax
I Installed Python 3.2 on Windows 7 machine.
Does anyone know what could be the cause for exception?
In Python 3, you must use the
askeyword., i.e.Run
in the
C:\Python32\tornado-2.3directory to generate a Python3 build (with 2to3) intornado/build/lib.