Python中文
首页
教程
问答
标签
搜索
登录
注册
从python中的JSON中提取特定元素
回答此问题可获得
20
贡献值,回答如果被采纳可获得
50
分。
<p>如何通过这个JSON格式打印“name”?在Python2.7中? 我基本上已经尝试过很多堆栈溢出的例子,但是它们都在做json.load文件如果已经有一个JSON作为输出,我不确定是否需要它。我试着把它裁剪成我需要的。任何帮助都会很好。非常感谢。在</p> <p>这是json示例,我只需要名称 PS:什么是u?我的输出不需要这个。在</p> <pre><code>{ u'data': { u'items': [ { u'created_at': 1401991208, u'name': u'Great Deals Singapore', u'path': u'organization/great-deals-singapore', u'type': u'Organization', u'updated_at': 1442343527}, { u'created_at': 1415172261, u'name': u'Secure Tech Alarm Systems Inc.', u'path': u'organization/secure-tech-alarm-systems-inc-', u'type': u'Organization', u'updated_at': 1432082588}, { u'created_at': 1307858564, u'name': u'Foodcaching', u'path': u'organization/foodcaching', u'type': u'Organization', u'updated_at': 1406611074}, { u'created_at': 1421406244, u'name': u'WP App Store', u'path': u'organization/wp-app-store', u'type': u'Organization', u'updated_at': 1421406364}, </code></pre>
0 条评论
分类:
Python问答
请先
登录
后评论
默认排序
时间排序
1 个回答
匿名
1天前
擅长:python、mysql、java
<p>假设dict被分配给某个变量<code>data</code>,那么您只需要迭代这些项并打印每个项的名称</p> <pre><code>for item in data['items']: print item['name'] </code></pre>
请先
登录
后评论
针对此问题:
更多的回答
关注
89
关注
收藏
1
收藏,
216
浏览
网友 提问于 2天前
相关Python问题
Python中两个字典的交集
7 回答
python中两个字符串上的异或操作数?
8 回答
Python中两个字符串中的类似句子
9 回答
Python中两个字符串之间的Hamming距离
5 回答
python中两个字符串之间的匹配模式
10 回答
python中两个字符串之间的按位或
6 回答
python中两个字符串之间的数据(字节)切片
4 回答
python中两个字符串之间的模式
5 回答
python中两个字符串作为子字符串的区别
2 回答
Python中两个字符串元组的比较
2 回答
Python中两个字符串列表中的公共字符串
9 回答
python中两个字符串的Anagram测试
6 回答
Python中两个字符串的正则匹配
1 回答
python中两个字符串的笛卡尔乘积
8 回答
Python中两个字符串相似性的比较
6 回答
python中两个字符串语义相似度的求法
1 回答
Python中两个字符置换成固定长度的字符串,每个字符的数目相等
10 回答
Python中两个对数方程之间的插值和平滑数据
4 回答
Python中两个对象之间的And/Or运算符
1 回答
python中两个嵌套字典中相似键的和值
1 回答