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/