Answers for "python loads json"

0

json load python

import json

with open('jsonfile.json', 'r') as f:
	data = json.load(f)
Posted by: Guest on July-29-2021
5

json python

import json

# some JSON:
x = '{ "name":"John", "age":30, "city":"New York"}'

# parse x:
y = json.loads(x)

# the result is a Python dictionary:
print(y["age"])
Posted by: Guest on March-24-2021

Python Answers by Framework

Browse Popular Code Answers by Language