I am trying to download a json file. Update it and write it down. Here is my attempt, but I get an error message:
TypeError: dump () accepts at least 2 arguments (1 set)
with open('employees.json') as data_file:
employees = json.load(data_file)
data_file.close
employees['employees'].append({
"id": "2",
"name": "Rob Croft",
"key": "0003837852"})
with open('employees.json', 'w') as data_file:
json.dump(employees)
data_file.close
source
share