Accessing a variable from one file in another
<p>I have a two-file setup:</p>

<blockquote>
  <p><strong>File 1</strong>:</p>
</blockquote>

<pre><code>global test
test = 1
import FooBar

FooBar()
</code></pre>

<blockquote>
  <p><strong>File 2 (FoorBar.py):</strong></p>
</blockquote>

<pre><code>class FooBar:
    def Foo:
       print test
</code></pre>

<p>Essentially, I want to pass the variable <code>test</code> from File 1 to File 2. With the above code I get the exception:</p>

<blockquote>
  <p>NameError: global name not defined (Python)</p>
</blockquote>
