Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Key Error Message in Python
Message
De
02/03/2023 14:01:16
 
 
À
Tous
Information générale
Forum:
Python
Catégorie:
Dépannage
Titre:
Key Error Message in Python
Divers
Thread ID:
01686300
Message ID:
01686300
Vues:
50
Respected Experts
I am trying this code to establish connection with Zerodha using zerodha Kite connect API.
Here is my code


import logging
from kiteconnect import KiteConnect
logging.basicConfig(level=logging.DEBUG)
key="4i567ljv5YNgrfdy"
kite = KiteConnect(api_key=key)
print(kite.login_url())

secret="eqzjjerdfxrkn5o6rtf4fi5pdxjyhb"

# Redirect the user to the login url obtained
# from kite.login_url(), and receive the request_token
# from the registered redirect url after the login flow.
# Once you have the request_token, obtain the access_token
# as follows.
data = kite.generate_session("siyi2w6eIbZ5tSDfZ0ATPR1RiSGWrboX",secret)
print(data)
# From Print(data) I get Acccess token and Place it in the line below and execute.
kite.set_access_token(data["85u1996Pgpy3+qNayVLeObo5ssdz"])



The Last line gives me an error as
Key Error : '85u1996Pgpy3+qNayVLeObo5ssdz'

This is exactly as per the kit connect documentation as available,
https://github.com/zerodha/pykiteconnect

Where I am doing wrong ?

Thanks
Harsh
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform