【发布时间】:2019-07-25 08:59:04
【问题描述】:
如何循环遍历数组中的每个 JSON 块?例如,我想遍历每个 JSON 块(而不是每个元素)并将其作为 API 调用中的主体发送。
print(json_data)
输出如下。
[
{
"occurrences": "1",
"post_title": "Test 9",
"ID": "17"
},
{
"occurrences": "2",
"post_title": "Test 8",
"ID": "19"
},
{
"occurrences": "5",
"post_title": "abc",
"ID": "11"
}
]
【问题讨论】:
-
你能提供一个你想要得到的例子吗?
-
您的尝试在哪里? StackOverflow 标题“开发人员学习、分享和建立职业生涯的地方”。
-
您拥有的是 dictionaries 的 list,而不是 JSON 块的 array >.
标签: python arrays json python-3.x