1import json
2
3data = {"key": "value"}
4
5with open('data.json', 'w') as jsonfile:
6 json.dump(data, jsonfile)
7
1import json
2
3with open('file_to_load.json', 'r') as file:
4 data = json.load(file)
1import json
2
3data = {}
4
5with open('data.txt', 'w') as outfile:
6 json.dump(data, outfile)
7