⇤ ← Revision 1 as of 2013-06-29 01:13:10
Size: 749
Comment:
|
← Revision 2 as of 2015-03-12 21:33:48 ⇥
Size: 783
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
## page was renamed from Tornado |
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()