title: How can I use external variables in Python like 'extern int x;' in C?
body: <p>How can I use external variables in Python, like <code>extern int x;</code> in C? </p>
  
  <p>For example, </p>
  
  <p><strong>main1.py:</strong></p>
  
  <pre><code>from myfunc import print_a 
  
  a = 10 
  print a    
  print_a()
  </code></pre>
  
  <p><strong>myfunc.py:</strong></p>
  
  <pre><code>def print_a():
      global a   
      print a
  </code></pre>