Json file example = {"process":[{"id":0,"path":"xyz"}, {"id":1,"path":"abc"}]}
with open(process_details.json,"r") as jsonfile:
write_data= json.load(jsonfile)
for processdetails in write_data['process']:
Path = function_to_retreive_path(processdetails['id'])
Write_data[processdetails]['path'] = Path
with open("process_details.json","w") as outfile:
json.dump(write_data,outfile)
As I'm trying to update the path for each process I'm able to retrieve the path but I'm unable to update it in process_details.json file. Getting the following error as unhashable type:'dict'
Can anyone advise me on this issue
with open(process_details.json,"r") as json— overwritingjsonjust before using itwrite_datais just before dumping to the question can help us provide answers without the need to include missing functions. (print(write_data))