0
我想用websocket打印流信息。服务器间歇发送信息。我在下面的python代码中使用while True:
循环打印它。如何从websocket(客户端)打印流信息?
有没有更好的方法?
from websocket import create_connection
def connect_Bitfinex_trades():
ws = create_connection("wss://api.sample.com:3000/ws")
print "Sent"
while True:
print "Receiving..."
result = ws.recv()
print "Received '%s'" % result
我使用这里找到https://pypi.python.org/pypi/websocket-client/