I'm trying to make a program that gets the "name" field out of the json file:
{
"accounts" : {
"fd1c3f81187b4a12b8e1226b0177a23basw" : {
"accessToken" : "",
"Profile" : {
"id" : "ca227f281b6e40eebcb4fa9ef6c326fawedsa34",
"name" : "random name"
},
"userProperites" : []
}
}
}
with the following code:
import json
json = json.loads('data.json')
accounts = json["accounts"]
for value in json["accounts"].values():
print(value["name"])
but i am getting the "Expecting value: line 1 column 1 (char 0)" error, how can i make it work?