Answers for "load python dictionary to json"

7

json file to dict python

import json

with open("data.json", "r") as json_file:
    my_dict = json.load(json_file)
Posted by: Guest on May-24-2021
1

python dict to json

import json
python_data = {'name': 'Dave', 'age': 42}
json_string = json.dumps(python_data)
Posted by: Guest on April-21-2022

Code answers related to "load python dictionary to json"

Code answers related to "Javascript"

Browse Popular Code Answers by Language