Z
Z
Zeffir2020-01-05 18:03:29
JSON
Zeffir, 2020-01-05 18:03:29

How to assign a value to a dictionary key in Python that is in a JSON file?

I have a JSON file that I wanted to populate with python code. Now I can only write to the file itself, but not to the dictionary in it. Maybe someone knows how to fill in a specific dictionary? Google didn't help me. Perhaps I'm wording the question incorrectly or I don't understand something.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
K
Kirill, 2019-03-12
@KirillSPB777

figured it out :) {"entry": "europaplus"}

A
Andrey, 2020-01-05
@Zeffir

Bad google. https://python-scripts.com/json

import json

with open("data_file.json", "r") as read_file:
    data = json.load(read_file)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question