Using a variable as part of a variable name
<p>I have object1 which has many sub-objects in it.  These sub-objects are accessed in the form <code>object1.subobject</code>.  I have a function which returns a list of sub-objects of the original object.  All I would like to do is iterate through the list and access each sub-object.  Something like this: </p>

<pre><code>temp_list = listSubChildren(object1)  #Get list of sub-objects
for sub_object in temp_list:          #Iterate through list of sub-objects
    blah = object1.sub-object         #This is where I need help 
    #Do something with blah           #So that I can access and use blah
</code></pre>

<p>I looked at similar questions where people used <code>dictionaries</code> and <code>getattr</code> but couldn't get either of those methods to work for this.</p>
