title: list indices must be integer python
body: <p>I have a dictionary, user_dict, and create a list for each user value, this list contains json object:</p>
  
  <pre><code>user_dict[user].append(obj)
  </code></pre>
  
  <p>Now I want to print all the items in this dictionary, but only select some field from each item in the list, so the dictionary is like this, I only list one user here</p>
  
  <pre><code>{u'user1':[{u'host_dst': {u'addr': u'195.149.144.60', u'vid': 0, u'port': 80},
  
              'usi': '7932fee11ba72ae84180044d75521368', u'host_src': {u'addr': u'83.233.59.215', 
  
              u'vid': 0, u'port': 51068},item2...]}
  </code></pre>
  
  <p>What I did is:</p>
  
  <pre><code>for item in user_dict.values():
      fd_out1.write("%s\t%s\n" % (item["host_dst"][addr],item["host_dst"]["vid"]))
  </code></pre>
  
  <p>and it returns:</p>
  
  <pre><code>TypeError: list indices must be integers, not str
  </code></pre>
  
  <p>Previously for example, I used obj["host_dst"][addr] to represent the value 195.149.144.60, and it works fine, but here when I want to print out something, it cannot work. Can anyone help? Many thanks!!</p>