Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

json python

#load and print elements of a json file
import json
file = "my_json_file.json"

Json = json.load(open(file)) #Json is a dictionary

print(Json)
#OUTPUT:	'{ "name":"John", "age":30, "city":"New York"}'

print("Hello",Json["name"])
#OUTPUT:	Hello John
 
PREVIOUS NEXT
Tagged: #json #python
ADD COMMENT
Topic
Name
7+9 =