title: Python - Poloniex Push API
body: <p>I am trying to get live data in Python 2.7.13 from Poloniex through the push API.
  I read many posts (including <a href="https://stackoverflow.com/questions/32154121/how-to-connect-to-poloniex-com-websocket-api-using-a-python-library">How to connect to poloniex.com websocket api using a python library</a>) and I arrived to the following code:</p>
  
  <pre><code>from autobahn.twisted.wamp import ApplicationSession
  from autobahn.twisted.wamp import ApplicationRunner
  from twisted.internet.defer import inlineCallbacks
  import six
  
  
  class PoloniexComponent(ApplicationSession):
      def onConnect(self):
          self.join(self.config.realm)
  
      @inlineCallbacks
      def onJoin(self, details):
          def onTicker(*args):
              print("Ticker event received:", args)
  
          try:
              yield self.subscribe(onTicker, 'ticker')
          except Exception as e:
              print("Could not subscribe to topic:", e)
  
  
  def main():
      runner = ApplicationRunner(six.u("wss://api.poloniex.com"), six.u("realm1"))
      runner.run(PoloniexComponent)
  
  
  if __name__ == "__main__":
      main()
  </code></pre>
  
  <p>Now, when I run the code, it looks like it's running successfully, but I don't know where I am getting the data. I have two questions:</p>
  
  <ol>
  <li><p>I would really appreciate if someone could walk me through the process of subscribing and getting ticker data, that I will elaborate in python, from step 0: I am running the program on Spyder on Windows. Am I supposed to activate somehow Crossbar? </p></li>
  <li><p>How do I quit the connection? I simply killed the process with <code>Ctrl+c</code> and now when I try to run it agan, I get the error: <code>ReactorNonRestartable</code>.</p></li>
  </ol>