How do I get all the variables that are in a module, but excluding the variables that are imported in that module
<p>So here's the scene. I have a module as: </p>

<p>Filename A:</p>

<pre><code>import a_local_module

item = [ 1, 2, 3]
</code></pre>

<p>Filename B:</p>

<pre><code>import A

list_of_variables = dir(A)
</code></pre>

<p>The thing here is that now there is a list of variables from <code>A</code> and <code>a_local_module</code>. But I want to get the list of variables declared in file <code>A</code> and not from its import of <code>a_local_module</code>.</p>

<p>Also assuming that I don't know what the imports in file A are.</p>

<p>Is there a way to do this?</p>