How to set global variable in different file
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/3400525/global-variable-from-a-different-file-python">Global Variable from a different file Python</a>  </p>
</blockquote>



<p>is that possible to set variable in different file ?</p>

<p>So I have two different files somewhat like this..</p>

<h2>tes1.py</h2>

<pre><code>import test2
st = 'a'
def main():
  mis = input('puts: ')
  print tes2.set(mis)
main()
</code></pre>

<h2>tes2.py</h2>

<pre><code>def set(object):
  pics = ['''
  %s
  1st
  '''%st,
  '''
  %s
  2nd
  ''']
  return pics[object]
</code></pre>

<p>and i execute tes1.py and issued an error:</p>

<pre><code>NameError: global name 'st' is not defined
</code></pre>

<p>thanks for the respond</p>
