Introduction to Web server Framework Tornado _python

Source: Internet
Author: User

Unlike other mainstream Web server frameworks (primarily the Python framework), Tornado uses Epoll non-blocking io, which responds quickly, handles thousands of concurrent connections, and is especially useful for real-time web services.

High Performance Web server framework Tornado simple implementation restful interface and development instance http://www.jb51.net/article/52209.htm

To use it, you must follow these kits:

1 python (Recommended use of Python 2.5/python 2.6)

2) Simplejson (recommended to use Simplejson 2.0.9)

3) CURL (recommended to use CURL 7.19.7 or above)

4) Pycurl (recommended to use Pycurl 7.16.2.1)

5 Tornado Web Server (This is the protagonist, version of the latest installation of the official online bar)

One of the simplest services:

Import tornado.ioloop
import Tornado.web

class 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 ()

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.