RHEL6 Installing Python Packages tornado
Tornado is a full-stack (full-stack) Web framework and asynchronous network library developed using Python, originally developed by FriendFeed. By using non-blocking io,tornado, you can handle tens of thousands of open connections, which are long polling, websockets, and others that need to be used to maintain long-connected applications for your users.
Unlike other major Web server frameworks (primarily the Python framework), Tornado uses epoll non-blocking IO, which responds quickly and handles thousands of of concurrent connections, especially for real-time Web services. The Tornado is divided into four main parts:
Web Framework (includes RequestHandler, base class for creating Web programs, and various support classes)
Implements the client and server side of HTTP (Httpserver and Asynchttpclient).
An asynchronous network library (Ioloop and IOStream)
A co-Libraries (Tornado.gen) that allows the asynchronous calling code to write in a more straightforward way instead of a callback link
One of the simplest Web services:
Import Tornado.ioloopimport tornado.webclass 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 ()
How to install Tornado on RHEL6.4
Here's how to install Tornado on RHEL6.4. I am using the Python2.6.6 version.
1) First Download tornado-4.1.tar.gz:
Https://pypi.python.org/packages/source/t/tornado/tornado-4.1.tar.gz
2) Install after decompression:
# TAR-ZXVF Tornado-4.1.tar.gz
# CD tornado-4.1
# yum Install gcc Python-devel
# python2.6 setup.py Build
# python2.6 setup.py Install
3) test the example above
# python2.6
>>> Import Tornado.ioloop
>>> Import Tornado.web
That's right!
RHEL6 Installing Python Packages tornado