Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

write to json file python

# Python program to write JSON
# to a file
  
  
import json
  
# Data to be written
dictionary ={
    "name" : "sathiyajith",
    "rollno" : 56,
    "cgpa" : 8.6,
    "phonenumber" : "9976770500"
}
  
with open("sample.json", "w") as outfile:
    json.dump(dictionary, outfile)
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #write #json #file #python
ADD COMMENT
Topic
Name
9+8 =