Python's high-performance web framework library Tornado

Tornado is a Python web framework.

Its main features are:

  • Pay attention to speed. It uses non-blocking I/O and can support high concurrent connections.
  • Using an event-driven architecture, it is very suitable for network programming.
  • Support HTTP client and server.
  • Support WebSocket programming.
  • Easy to expand.

The main components of Tornado:

  1. HTTP Server: Used to develop web applications. Has its own URL routing.
  2. HTTP Client: Used to send requests to other HTTP services.
  3. IOLoop: An event-driven I/O loop that provides support for non-blocking I/O.
  4. Asynchronous networking library: Provides a coroutine-oriented network library.
  5. Template engine: Used to render HTML templates.
  6. WebSocket support: supports the WebSocket protocol.

Example of use:

import tornado.web

class MainHandler(tornado.web.RequestHandler):
    def 

Guess you like

Origin blog.csdn.net/zhangzhechun/article/details/131567857