RHEL6 Installing Python Packages tornado

Source: Internet
Author: User

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

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.