title: How to print streaming information from a websocket(client)?
body: <p>I want to print streaming information using a websocket. The server is sending out information intermittently. I am printing it using the <code>while True:</code> loop in the python code below. </p>
  
  <p>Is there a better way?</p>
  
  <pre><code>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
  </code></pre>
  
  <p>I am using the websocket client found here <a href="https://pypi.python.org/pypi/websocket-client/" rel="nofollow noreferrer">https://pypi.python.org/pypi/websocket-client/</a></p>