title: Importing variables from another file in Python
body: <p>I have declared a few variables and initialised them with some value in <code>variables.py</code>:</p>
  <pre><code>flag = 0
  j = 1
  </code></pre>
  <p>I want to use those values in another file <code>main_file.py</code>:</p>
  <pre><code>import variables
  if(flag == 0) :
     j = j+1
  </code></pre>
  <p>However I get the following error,</p>
  <pre><code>NameError: name 'flag' is not defined
  </code></pre>
  <p>How can i solve this problem?</p>