解析dict中的嵌套键(从json生成)

2024-10-02 14:20:57 发布

您现在位置:Python中文网/ 问答频道 /正文

我在看anisbythonapi,它通过json返回值,然后可以将其存储为dict

{
"dark" : {
   "web1.example.com" : "failure message"
},
"contacted" : {
   "web2.example.com" : 1
}
}

我觉得这是一个挑战dict.获取web2的嵌套值。example.com网站,联系不足。在

提前谢谢。我会举我的例子,但是他们没有提供任何有用的东西。在

参考文献: https://github.com/ansible/ansible/blob/12a2585e84be7fdf40e07ca1415f4938e95de1f3/docsite/rst/developing_api.rst


Tags: comjsonmessagefailure网站examplerstansible