0
{"query":{"normalized":[{"from":"hijab","to":"Hijab"}],"pages":{"68301":{

在 Linux (Python) 中:

>>> data['query']['pages']
{u'68301': {u'extract': u'<p/>"</b>Hijab</b>" or "</b>\u1e25ij\u0101b</b>" (/h\u026a\u02c8d\u0292\u0251\u02d0b/, /h\u026a\u02c8d\u0292\xe6b/, /\u02c8h\u026a.d\u0292\xe6b/ or /h\u025b\u02c8d\u0292\u0251\u02d0b/;Arabic: \u062d\u062c\u0627\u0628\u200e, <small>pronounced&#160;</small>[\u0127i\u02c8d\u0292\xe6\u02d0b] ~ [\u0127i\u02c8\u0261\xe6\u02d0b]) is a veil which covers the head which is particularly worn by Muslim women beyond the age of puberty in the presence of non-related adult males.</p>', u'ns': 0, u'pageid': 68301, u'title': u'Hijab'}}

谁能帮助我如何获取该号码(68301

4

2 回答 2

3

数字是字典中的一个键:

>>> data['query']['pages'].keys()
[u'68301']

.keys()返回字典键列表,请参阅Pythondict类型文档以获取字典的完整 API。

于 2013-01-31T13:36:02.267 回答
1

因为这是一个字典,您可以使用以下keys功能:

data['query']['pages'].keys()
于 2013-01-31T13:36:33.983 回答