【发布时间】:2014-06-07 11:33:40
【问题描述】:
Twitter API 会为如下所示的实体生成列表:
[{'expanded_url': 'http://twitter.com/voxdotcom/status/458708072131592194/photo/1', 'display_url': 'pic.twitter.com/uc3j0nU8uf', 'url': 'http://t.co/uc3j0nU8uf', 'media_url_https': 'https://pbs.twimg.com/media/Bl2oj5_CYAAO72v.png', 'id_str': '458708071875764224', 'sizes': {'small': {'h': 256, 'resize': 'fit', 'w': 340}, 'large': {'h': 773, 'resize': 'fit', 'w': 1023}, 'medium': {'h': 453, 'resize': 'fit', 'w': 599}, 'thumb': {'h': 150, 'resize': 'crop', 'w': 150}}, 'indices': [88, 110], 'type': 'photo', 'id': 458708071875764224, 'media_url': 'http://pbs.twimg.com/media/Bl2oj5_CYAAO72v.png'}]
它看起来像字典,但实际上是一个列表。参数。
如何访问特定条目?例如,如果我想要 expand_url 值,那么获取它的最佳方法是什么?
谢谢。
*感谢您的快速回复。
【问题讨论】:
标签: python list python-3.x twitter dictionary