Type in CMD and Hit Enter:pip install websocket-client==0.40.0
from upstox_api.api import *
api_key=open('api_key.txt','r').read()
access_token=open('access_token.txt','r').read()
u=Upstox(api_key,access_token)
u.get_master_contract('NSE_FO')
def event_handler_quote_update(message):
print(message)
u.set_on_quote_update( event_handler_quote_update)
u.subscribe(u.get_instrument_by_symbol('NSE_FO','RELIANCE19JUNFUT'),LiveFeedType.Full)
u.start_websocket(True)