【发布时间】:2021-07-08 08:49:04
【问题描述】:
我无法在我的 PC 上运行此代码,但它在服务器上运行良好
import asyncio
import websockets
async def hello():
async with websockets.connect('wss://fstream.binance.com/stream?streams=ethusdt@depth5@100ms') as websocket:
while True:
msg = await websocket.recv()
print(msg)
asyncio.run(hello())
【问题讨论】:
-
如果您提供有关 PC 和服务器之间差异的信息会有所帮助,例如他们正在运行什么操作系统、python 版本等。这些信息可以帮助人们查明可能的原因。
标签: python-3.x websocket