Coding Global Background
Coding Global

Hilfe bei PY

Archived 2 years ago
35 messages
2 members
3 years ago
Open in Discord
M
Maxi
Copy Paster!

```py 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"]``` ```py 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?

Replies (35)