title: How does Python importing exactly work?
body: <p>I have two specific situations where I don't understand how importing works in Python:</p>
  
  <p><strong>1st specific situation:</strong></p>
  
  <p>When I import the same module in two different Python scripts, the module isn't imported twice, right? The first time Python encounters it, it is imported, and second time, does it check if the module has been imported, or does it make a copy?</p>
  
  <p><strong>2nd specific situation:</strong></p>
  
  <p>Consider the following module, called <code>bla.py</code>:</p>
  
  <pre><code>a = 10
  </code></pre>
  
  <p>And then, we have <code>foo.py</code>, a module which imports <code>bla.py</code>:</p>
  
  <pre><code>from bla import *
  
  def Stuff ():
      return a
  </code></pre>
  
  <p>And after that, we have a script called <code>bar.py</code>, which gets executed by the user:</p>
  
  <pre><code>from foo import *
  Stuff() #This should return 10 
  a = 5
  Stuff()
  </code></pre>
  
  <p>Here I don't know: Does <code>Stuff()</code> return 10 or 5?</p>