【发布时间】:2018-01-29 23:37:59
【问题描述】:
以下是我拥有的 JSON 数据,我试图仅获取名称 after_count。
{
"total_count": 125,
"limit": 100,
"operatingsystems": [
{
"category": null,
"name": "abc",
"total_count": 1,
"notes": "",
"after_count": 11,
"id": 1,
"aliases": []
},
{
"category": null,
"name": "cdef",
"total_count": 2,
"notes": "",
"after_count": 62,
"id": 2,
"aliases": []
},
我的代码:
data = [item for item in objects if item["after_count"] >= 0]
我得到的输出:
"
a
l
i
a
s
e
s
"
:
[
]
有人可以指导我正确的方向吗?
【问题讨论】:
标签: python python-3.x python-2.7 python-requests