How to get all objects in a module in python?
<p>I'm kind of new to python and I'm stuck on a problem.</p>

<p>So i've been trying to think of a way to get a list of all the objects within a module -- not a list of just their names. So, for instance, I have:</p>

<pre><code>class myClass:  
    def __init__(self):  
        (code)

class thing1(myClass):  
    def __init__(self):  
        self.x = 1

class thing2(myClass):  
    def __init__(self):
        self.x = 2
</code></pre>

<p>and so on. </p>

<p>What I want is something that will give me a list of the objects in myClass (thing1, thing2) from which i can call methods / get attributes. I'm trying to do something like this:</p>

<pre><code>for myThing in dir(myClass):  
    print myThing.x
</code></pre>

<p>But the dir function only gives a list of the names of the classes, and you can't get the attribute from that. I'm sure there's a way to do this, I just don't know what it is.</p>

<p>Any and all help is greatly appreciated! Thank you so much!!</p>
