擅长:python、mysql、java
<p>您还可以使用下面的iteritems方法简单地访问<code>key/value</code>对。而不是像下面这样打印,你可以执行你的操作。在</p>
<pre><code>In [14]: user1 = playlists.get('user')[0]
In [15]: for key, value in user1.iteritems():
....: print key
....: print value
....:
playlist
{'tracks': [{'count': '1.0', 'name': 'Karma Police', 'artist': 'Radiohead'}, {'count': '2.0', 'name': 'Bitter Sweet Symphony', 'artist': 'The Verve'}]}
</code></pre>