Answer the question
In order to leave comments, you need to log in
Why are the wrong python values being added to the json file?
My code:
logpass = []
infuser = {}
infuser[logpass[0]] = {
'login': logpass[1],
'password': logpass[2]
}
testlist.append(infuser)
with open('accounts.json', 'w', encoding="utf-8") as f:
json.dump(testlist, fp=f, ensure_ascii=False, indent=4)
Answer the question
In order to leave comments, you need to log in
If this happens several times in a row in one run, the problem is most likely that the logpass is not cleared, and the values \u200b\u200bthat were there before are still used
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question