每次我從JSON數據提取JSON數據提取,我就得到了TypeError: unhashable type: 'dict'
Django的 - 使用Python
我的JSON信息
u 'paging': {
u 'cursors': {
u 'after': u 'MTQyNzMzMjE3MDgxNzUzOQZDZD', u 'before': u 'OTUzNDg3MjMxMzQ2NjQ0'
}
}, u 'data': [{
u 'access_token': u 'XXXXX',
u 'category': u 'Internet/Software', u 'perms': [u 'ADMINISTER',
u 'EDIT_PROFILE', u 'CREATE_CONTENT', u 'MODERATE_CONTENT',
u 'CREATE_ADS', u 'BASIC_ADMIN'
], u 'name': u 'Nurdin Norazan Services', u 'id': u '953487231346644'
}, {
u 'access_token': u 'XXXXX',
u 'category': u 'Internet/Software', u 'perms': [u 'ADMINISTER',
u 'EDIT_PROFILE', u 'CREATE_CONTENT', u 'MODERATE_CONTENT',
u 'CREATE_ADS', u 'BASIC_ADMIN'
], u 'name': u 'Intellij System Solution Sdn. Bhd.', u 'id': u '433616770180650'
}]
}
我的代碼
data = json.load(urllib2.urlopen("https://graph.facebook.com/v2.7/me/accounts?access_token="XXXXX")
print (data[data][0][id]) //953487231346644
BTW,如何打印循環數據?
請指教。謝謝。
如何在循環打印? –
用'for'循環? –
是的,如何打印循環使用? –