ReactorNotRestartable

ravidparikh92
I am beggining to learn kiteconnect and was trying out the exampled codes given on github...however i am facing the
ReactorNotRestartable error.

Below is my code I have mentioned the error I get in comments


logging.basicConfig(level=logging.DEBUG)
kws_1=KiteTicker(api_key,access_token)

def on_ticks(ws, ticks):
logging.debug("Ticks: {}".format(ticks))

def on_connect(ws, response):
ws.subscribe([738561, 5633])
ws.set_mode(ws.MODE_FULL, [738561])

def on_close(ws, code, reason):
ws.stop()

# Assign the callbacks.
kws_1.on_ticks = on_ticks
kws_1.on_connect = on_connect
kws_1.on_close = on_close


# Infinite loop on the main thread. Nothing after this will run.
# You have to use the pre-defined callbacks to manage subscriptions.
kws_1.connect()
Sign In or Register to comment.