Answers for "dict to json payoad python"

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
0

python dictionary to json

import json

# json -> string
j1 = {"name": "steve", "age": 64}
s1 = json.dumps(j)

# string -> json
s2 = '{"name": "steve", "age": 64}'
j2 = json.loads(s)
Posted by: Guest on January-06-2022

Code answers related to "Javascript"

Browse Popular Code Answers by Language