Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

how to add data to file json in python

import json

path="......"

with open(path) as f:
   obj = json.load(f) 

obj["data"].append({"name":"hayder zaeim"})

with open(path,"w+") as of:
   json.dump(obj,of)
 
PREVIOUS NEXT
Tagged: #add #data #file #json #python
ADD COMMENT
Topic
Name
7+7 =