Answers for "how to load a json from string in python"

66

python read json file

import json

with open('path_to_file/person.json') as f:
  data = json.load(f)

print(data)
Posted by: Guest on April-08-2020
0

get value json python

print(json_object_string)
OUTPUT
{"id":"20", "name":"Bob"}

json_object = json.loads(json_object_string)

print(json_object["name"])
OUTPUT
Bob
Posted by: Guest on March-20-2021

Code answers related to "how to load a json from string in python"

Python Answers by Framework

Browse Popular Code Answers by Language