RHEL6 install python package tornado

Source: Internet
Author: User

RHEL6 install python package tornado
RHEL6 install python package tornado

 

Tornado is a full-stack Web framework and Asynchronous Network library developed using Python. It was first developed by Friendfeed. By using non-blocking IO, Tornado can process tens of thousands of open connections, which is an ideal choice for long polling, WebSockets, and other applications that require maintenance of persistent connections.

Unlike other mainstream Web Server frameworks (mainly Python frameworks), tornado uses epoll for non-blocking I/O and responds quickly. It can process thousands of concurrent connections and is especially suitable for real-time Web services. Tornado consists of four parts:

Web framework (including RequestHandler, the base class used to create Web programs, and various support classes)

Implement HTTP client and server (HTTPServer and AsyncHTTPClient ).

An Asynchronous Network Library (IOLoop and IOStream)

A coroutine Library (tornado. gen) allows the asynchronous call code to be written in a more direct way, replacing the 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

The following describes how to install tornado on RHEL6.4. I am using Python 2.6.6.

1) download tornado-4.1.tar.gz first:

2) unzip the package and install:

# 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 above example

# Python2.6

>>> Import tornado. ioloop

Correct!

    Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.