how to print jsonstore object in python code example
Example: python json file operations
import json
with open("jsonfile.json", "r") as jsonFile:
data = json.load(jsonFile)
'''
Example Json File:
[{"name": "Bill", "age": 20},
{"name": "Mary", "age": 31},
{"name": "Jake", "age": 19}]
'''
data[1]["age"] = 32
'''
Now the data variable is:
[{"name": "Bill", "age": 20},
{"name": "Mary", "age": 32},
{"name": "Jake", "age": 19}]
'''
with open("jsonfile.json", "w") as fileJson:
json.dump(data, fileJson)