json python to dict code example
Example 1: save a dict to json python
import json
with open('data.json', 'w') as fp:
json.dump(data, fp)
Example 2: python json string to object
import json
x = '{ "name":"John", "age":30, "city":"New York"}'
y = json.loads(x)
print(y["age"])