I've tried running the WebSocket connect example on Python 3.7. The IDLE screen goes blank on running the code with no streaming quotes shown. On pressing Ctrl C it shows a long error log with the following error message at the end. I am quite sure that i am using the correct api key and access token. Any help will be greatly appreciated! Error Message: py", line 647, in stop "Can't stop reactor that isn't running.") twisted.internet.error.ReactorNotRunning: Can't stop reactor that isn't running.
Example used: import logging from kiteconnect import KiteTicker kws = KiteTicker(api_key, access_token)
def on_ticks(ws, ticks): # Callback to receive ticks logging.debug("Ticks: {}".format(ticks))
def on_connect(ws, response): # Callback on successful connect # Subscribe to a list of instrument_tokens (RELIANCE and ACC here). ws.subscribe([738561, 5633])
# Set RELIANCE to tick in 'full' mode ws.set_mode(ws.MODE_FULL, [738561])
def on_close(ws, code, reason): # On connection close stop the event loop. # Reconnection will not happen after executing `ws.stop()` ws.stop()