Tornado
Tornado is a Python web framework and asynchronous networking library. http://www.tornadoweb.org/en/stable/
Install
wget https://pypi.python.org/packages/source/t/tornado/tornado-3.1.tar.gz
- cp tornado-3.1.tar.gz /tmp
- cd /tmp
- tar xvzf tornado-3.1.tar.gz
- cd tornado-3.1
- python setup.py build
- su
- python setup.py install
Test
1 import tornado.ioloop
2 import tornado.web
3
4 class MainHandler(tornado.web.RequestHandler):
5 def get(self):
6 self.write("Hello, world")
7
8 application = tornado.web.Application([
9 (r"/", MainHandler),
10 ])
11
12 if __name__ == "__main__":
13 application.listen(8888)
14 tornado.ioloop.IOLoop.instance().start()