Answers for "using json.loads in python"

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
2

Json in python

import json

json_file = json.load(open("your file.json", "r", encoding="utf-8"))

# For see if you don't have error:
print(json_file)
Posted by: Guest on October-16-2020

Python Answers by Framework

Browse Popular Code Answers by Language