Tornado 6.5 Documentation
Tornado Authors May 22, 2025CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . linksCHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 272 页 | 1.12 MB | 2 月前3Tornado 6.4 Documentation
Tornado Authors Jan 12, 2024 CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.4 Documentation
Tornado Authors Nov 29, 2023 CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.4 Documentation
Tornado Authors Nov 29, 2023 CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 268 页 | 1.09 MB | 1 年前3Tornado 6.2 Documentation
Tornado Authors Jul 03, 2022 CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado.web class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 260 页 | 1.06 MB | 1 年前3Tornado 6.3 Documentation
Tornado Authors Aug 11, 2023 CONTENTS 1 Quick links 3 2 Hello, world 5 3 Threads and WSGI 7 4 asyncio Integration 9 5 Installation 11 6 Documentation 13 6.1 User’s guide . . . . . . . . . . . . . CHAPTER TWO HELLO, WORLD Here is a simple “Hello, world” example web app for Tornado: import asyncio import tornado class MainHandler(tornado.web.RequestHandler): def get(self): self.write("Hello MainHandler), ]) async def main(): app = make_app() app.listen(8888) await asyncio.Event().wait() if __name__ == "__main__": asyncio.run(main()) This example does not use any of Tornado’s asynchronous features;0 码力 | 264 页 | 1.06 MB | 1 年前3websockets Documentation Release 5.0
on top of asyncio, Python’s standard asynchronous I/O framework, it provides an elegant coroutine-based API. Here’s a client that says “Hello world!”: #!/usr/bin/env python import asyncio import websockets websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) And here’s an echo server: #!/usr/bin/env python import asyncio import websockets async def echo(websocket message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets.serve(echo, 'localhost', 8765)) asyncio.get_event_loop().run_forever() Do you like it? Let’s0 码力 | 56 页 | 245.43 KB | 1 年前3websockets Documentation Release 6.0
on top of asyncio, Python’s standard asynchronous I/O framework, it provides an elegant coroutine-based API. Here’s a client that says “Hello world!”: #!/usr/bin/env python import asyncio import websockets websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) And here’s an echo server: #!/usr/bin/env python import asyncio import websockets async def echo(websocket message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets.serve(echo, 'localhost', 8765)) asyncio.get_event_loop().run_forever() Do you like it? Let’s0 码力 | 58 页 | 253.08 KB | 1 年前3websockets Documentation Release 9.0
top of asyncio, Python’s standard asynchronous I/O framework, it provides an elegant coroutine-based API. Here’s how a client sends and receives messages: #!/usr/bin/env python import asyncio import send("Hello world!") await websocket.recv() asyncio.get_event_loop().run_until_complete(hello()) And here’s an echo server: #!/usr/bin/env python import asyncio import websockets async def echo(websocket send(message) start_server = websockets.serve(echo, "localhost", 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() Do you like it? Let’s dive in! CONTENTS0 码力 | 81 页 | 352.88 KB | 1 年前3websockets Documentation Release 4.0
on top of asyncio, Python’s standard asynchronous I/O framework, it provides an elegant coroutine-based API. Here’s a client that says “Hello world!”: #!/usr/bin/env python import asyncio import websockets websocket.send("Hello world!") asyncio.get_event_loop().run_until_complete( hello('ws://localhost:8765')) And here’s an echo server: #!/usr/bin/env python import asyncio import websockets async def echo(websocket message in websocket: await websocket.send(message) asyncio.get_event_loop().run_until_complete( websockets.serve(echo, 'localhost', 8765)) asyncio.get_event_loop().run_forever() Do you like it? Let’s0 码力 | 48 页 | 224.70 KB | 1 年前3
共 227 条
- 1
- 2
- 3
- 4
- 5
- 6
- 23