It looks like you're new here. If you want to get involved, click one of these buttons!
Traceback (most recent call last):
File "<ipython-input-35-ef8cc35a2e1b>", line 1, in <module>
kws.connect()
File "C:\Users\avidh\Anaconda3\lib\site-packages\kiteconnect\ticker.py", line 532, in connect
reactor.run(**opts)
File "C:\Users\avidh\Anaconda3\lib\site-packages\twisted\internet\base.py", line 1260, in run
self.startRunning(installSignalHandlers=installSignalHandlers)
File "C:\Users\avidh\Anaconda3\lib\site-packages\twisted\internet\base.py", line 1240, in startRunning
ReactorBase.startRunning(self)
File "C:\Users\avidh\Anaconda3\lib\site-packages\twisted\internet\base.py", line 748, in startRunning
raise error.ReactorNotRestartable()
ReactorNotRestartable
from kiteconnect import KiteTicker
api_key="t1hpf1q325z2xhqg"
api_secret=""
access_token=""
public_token=""
kws = KiteTicker(api_key,access_token)
def on_ticks(ws,ticks):
print(ticks)
print("\n")
def on_connect(ws,response):
ws.subscribe([177655])
ws.set_mode(ws.MODE_QUOTE,[177655])
kws.on_ticks = on_ticks
kws.on_connect = on_connect
kws.connect()
P.S. I have removed public token and access token values from the above code
It seems to be some issue with your Anaconda environment. Websocket code is working fine in our Linux Anaconda environment on Jupyter Notebook.
Might be this open issue of twisted.
Thanks a lot for the response.
I am very new to Python and Anaconda environment. Is there any way I can sort this out on Windows?
If you are not concerned about acute performance computing, you may use the default python setup.
Thanks a lot, guys.