websockets Documentation
Release 5.0connect(uri) as websocket: await 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 async for 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 {greeting}") start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the0 码力 | 56 页 | 245.43 KB | 1 年前3
websockets Documentation
Release 6.0connect(uri) as websocket: await 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 async for 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 {greeting}") start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the0 码力 | 58 页 | 253.08 KB | 1 年前3
websockets Documentation
Release 4.0connect(uri) as websocket: await 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 async for 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 format(greeting)) start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, the handler coroutine0 码力 | 48 页 | 224.70 KB | 1 年前3
websockets Documentation
Release 9.0await websocket.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 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! CONTENTS 1 page) start_server = websockets.serve(hello, "localhost", 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() On the server side, websockets executes the0 码力 | 81 页 | 352.88 KB | 1 年前3
websockets Documentation
Release 3.4format(greeting)) start_server = websockets.serve(hello, 'localhost', 8765) asyncio.get_event_loop().run_until_complete(start_server) asyncio.get_event_loop().run_forever() 7 websockets Documentation, Release 3.4 greeting = await websocket.recv() print("< {}".format(greeting)) asyncio.get_event_loop().run_until_complete(hello()) async and await aren’t available in Python < 3.5. Here’s how to adapt the client example {}".format(greeting)) finally: yield from websocket.close() asyncio.get_event_loop().run_until_complete(hello()) Browser-based example Here’s an example of how to run a WebSocket server and connect0 码力 | 36 页 | 192.66 KB | 1 年前3
Jupyter Notebook 5.7.5 Documentationaccompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics Interactive widgets - Plots - Narrative text - Equations - Images - Video These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. When you run the notebook web application on your computer0 码力 | 155 页 | 1.71 MB | 1 年前3
Jupyter Notebook 5.7.0 Documentationaccompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics Interactive widgets - Plots - Narrative text - Equations - Images - Video These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. When you run the notebook web application on your computer0 码力 | 145 页 | 1.83 MB | 1 年前3
Jupyter Notebook 5.7.3 Documentationaccompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics Interactive widgets - Plots - Narrative text - Equations - Images - Video These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. When you run the notebook web application on your computer0 码力 | 155 页 | 1.86 MB | 1 年前3
Jupyter Notebook 5.7.6 Documentationaccompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics Interactive widgets - Plots - Narrative text - Equations - Images - Video These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. When you run the notebook web application on your computer0 码力 | 155 页 | 1.71 MB | 1 年前3
Jupyter Notebook 5.7.1 Documentationaccompanies the code but is not meant for execution. In this way, notebook files can serve as a complete computational record of a session, interleaving executable code with explanatory text, mathematics Interactive widgets - Plots - Narrative text - Equations - Images - Video These documents provide a complete and self-contained record of a computation that can be converted to various formats and shared with running code, including HTML, images, video, and plots, is embeddeed in the notebook, which makes it a complete and self-contained record of a computation. When you run the notebook web application on your computer0 码力 | 145 页 | 1.82 MB | 1 年前3
共 451 条
- 1
- 2
- 3
- 4
- 5
- 6
- 46













