title: Iterate a tuple of dictionaries and pass the nested dictionaries to a function
body: <pre><code>#!/usr/bin/python -tt
  
  # A dictionary Of Each New SSID
  WirelessNetwork = {}
  WirelessNetwork['name'] = 'baz'
  WirelessNetwork['type'] = 'bar'
  WirelessNetwork['pass'] = 'foo'
  
  # A list of all SSIDs
  networkAddList = (WirelessNetwork)
  
  def addWireless(passedDict={}):
    print 'Adding SSID: %s' % passedDict['name']
    print 'Of type: %s' % passedDict['type']
    print 'With Password: %s' % passedDict['pass']
  
  for networkDict in networkAddList:
    addWireless(networkDict)
  </code></pre>
  
  <p>So I have a List "networkAddList" full of dictionaries ,i.e. "WirelessNetwork".
  I want to iterate that list "for networkDict in networkAddList"
  and pass the dictionary itself to my function "addWireless"</p>
  
  <p>When I run the sample code above I get the following error:</p>
  
  <pre><code>TypeError: 'string indices must be integers, not str'
  </code></pre>
  
  <p>Which makes me think that python thinks passedDict is a string, thus thinking I want string indices i.e. 0 or something rather then the key 'name'. I'm new to python but I am going to have to do this kind of thing a lot so I hope somebody can point me in the right direction as I think its pretty simple. But I can't change the basic idea , i.e. a list of dictionaries.</p>