Hilfe bei PY
Archived 3 years ago
M
Maxi
Script Kiddie!
if os.path.exists(os.getcwd() + "/config.json"):
with open("./config.json") as f:
configData = json.load(f)
else:
configTemplate = {"bannedWords": []}
with open(os.getcwd() + "/config.json", "w+") as f:
json.dump(configTemplate, f)
bannedWords = configData["bannedWords"]Traceback (most recent call last):
File "/home/container/main.py", line 57, in <module>
bannedWords = configData["bannedWords"]
KeyError: 'bannedWords' weiß wer, wo das Problem liegt?
