saving dict to json file with python code example
Example 1: write dict to json python
import json
with open('result.json', 'w') as fp:
json.dump(sample, fp)
Example 2: json file to dict python
import json
with open("data.json", "r") as json_file:
my_dict = json.load(json_file)