Deserializing JSON :
load()
method is used for it.with open("Sample.json", "r") as read_it: data = json.load(read_it)
json_var =""" { "Country": { "name": "INDIA", "Languages_spoken": [ { "names": ["Hindi", "English", "Bengali", "Telugu"] } ] } } """ var = json.loads(json_var)
load()
, which is usually used to load from string, otherwise the root object is in list or dict.
Comments