How to get a list of variables in specific Python module?
<p>Let's assume I have the following file structure:</p>

<p><strong>data.py</strong></p>

<pre><code>foo = []
bar = []
abc = "def"
</code></pre>

<p><strong>core.py</strong></p>

<pre><code>import data
# do something here #
# a = ...
print a
# ['foo', 'bar', 'abc']
</code></pre>

<p>I need to get all the variables defined in data.py file. How can I achieve that? I could use <code>dir()</code>, but it returns all the attributes of the module including <code>__name__</code> and so on.</p>
