I need to append dictionary values to an already existing JSON file. How can I be able to do that?
My details.json File
{"name": "someName"}
Dictionary generated by my python script
list1 = {"name": "someOthername"}
with open("details.json") as r:
data = json.load(r)
desirableDict = data.append(list1) # It has to be something like this
print(desirableDict)
Desirable Output: {"name": ["someName", "someOthername"]}