利用WebSocket实现教育系统接口开发 - import asyncio
ws
pip install ws
education_system
import asyncio
import websockets
async def echo(websocket, path):
while True:
message = await websocket.recv()
print(f"收到消息: {message}")
await websocket.send(f"你发送的消息是: {message}")
start_server = websockets.serve(echo, "localhost", 8765)
asyncio.get_event_loop().run_until_complete(start_server)
asyncio.get_event_loop().run_forever()
echo
http://localhost:8765/?path=/echo/echoHello, World!你好,世界! 拼多多帮助力入口