Answer the question
In order to leave comments, you need to log in
How to add json file?
For example, I have a test.json file.
I need to add values \u200b\u200bto the file with each new user
"Vk_id"={
"nick"=" "
"vip_status"=false
"words"=195
}
Answer the question
In order to leave comments, you need to log in
Pashenka has already written a solution for
you in a comment:
1. Read the file
2. Using json.loads, convert to dict
3. Add
4. Convert to json using json.dumps
5. Write to file
And in the example that you gave - json is invalid
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question