最佳答案
{
"glossary":
{
"title": "example glossary",
"GlossDiv":
{
"title": "S",
"GlossList":
{
"GlossEntry":
{
"ID": "SGML",
"SortAs": "SGML",
"GlossTerm": "Standard Generalized Markup Language",
"Acronym": "SGML",
"Abbrev": "ISO 8879:1986",
"GlossDef":
{
"para": "A meta-markup language, used to create markup languages such as DocBook.",
"GlossSeeAlso": ["GML", "XML"]
},
"GlossSee": "markup"
}
}
}
}
}
但是当我执行print(dict(json))
时,我得到一个错误。
如何将此字符串转换为结构,然后调用json["title"]
来获得"example glossary"
?