I want to print streaming information using a websocket. The server is sending out information intermittently. I am printing it using the while True:
loop in the python code below.
Is there a better way?
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
I am using the websocket client found here https://pypi.python.org/pypi/websocket-client/