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.

0 Answers

· Write an Answer

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.