question

oasis701 avatar image
0 Likes"
oasis701 asked ·

python API KeyError

Hi I wrote as follows; # ------------ module------------ # import configparser # eBayAPI config = configparser.ConfigParser() config.read('input/ parameters.txt') APPID = config["API"]["APPID"] DEVID = config["API"]["DEVID"] CERTID = config["API"]["CERTID"] TOKEN = config["API"]["TOKEN"] The parameters.txt is [API] APPID = XXXX-YYYYY-KKKK DEVID = 6666-uuuuu-kkkkk CERTID = Prf-xxxxx-zzzzz TOKEN = long token Then, I run the python Traceback (most recent call last): File "C:/Users/oashi/PycharmProjects/Community_programming/ method-test.py", line 7, in <module> APPID = config["API"]["APPID"] File "C:\Users\xxxi\Anaconda3\lib\ configparser.py", line 959, in __getitem__ raise KeyError(key) KeyError: 'API' Suddenly, the error happened. Would you all please let me know why? Thanks
apipython
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
sanjeev_developersupport avatar image
0 Likes"
sanjeev_developersupport answered ·
Hi @oasis701, We need a little more infomration, 1. What API are you using? 2. Can you send the full error? 3. Did this API work previously or are you trying to make this API call for the first time? 4. Can you also send your eBay developer user?
· Share
10 |600 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.