background preloader

Python

Facebook Twitter

Python Bibliotheca. Python Tutorials, more than 300, updated March 2, 2009 and carefully sorted by topic and category. Hidden features of Python. Tornado Web Server. Tornado is a Python web framework and asynchronous networking library, originally developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to tens of thousands of open connections, making it ideal for long polling, WebSockets, and other applications that require a long-lived connection to each user. Upgrade notes As of Tornado 3.2, the backports.ssl_match_hostname package must be installed when running Tornado on Python 2. This will be installed automatically when using pip or easy_install. Hello, world Here is a simple “Hello, world” example web app for Tornado: 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() This example does not use any of Tornado’s asynchronous features; for that see this simple chat room.

Installation. Afpy — Association Francophone Python. Python Bibliotheca. Plongez au coeur de Python. Domptage de serpents pour les enfants.