1a_dictionary = {"d": 4}
2
3with open("sample_file.json", "r+") as file:
4 data = json.load(file) # get data from file
5 update(a_dictionary)
6 seek(0)
7 json.dump(data, file) # insert data in file
1a_dictionary = {"d": 4}
2
3with open("sample_file.json", "r+") as file:
4 data = json.load(file)
5 update(a_dictionary)
6 seek(0)
7 dump(data, file)