title: How importing works. Why imported modules not inheriting other imported modules
body: <p>I just "thought" I understood how importing and modules work but obviously I need more schooling.</p>
  
  <p>Here is an example program (just a test case of somerthing I'm doing that is much bigger in scope and scale) and a module:</p>
  
  <p>quick.py</p>
  
  <pre><code>import gtk
  from quick_window import *
  
  w.show_all()
  gtk.main()
  </code></pre>
  
  <p>quick_window.py</p>
  
  <pre><code>w = gtk.Window()
  w.connect('destroy', lambda w: gtk.main_quit())
  l=gtk.Label('Hello')
  w.add(l)
  </code></pre>
  
  <p>running I get</p>
  
  <pre><code>$ python quick.py
  Traceback (most recent call last):
    File "quick.py", line 2, in &lt;module&gt;
      from quick_window import *
    File "/home/woodnt/Dropbox/python/weather_project/plugins/quick_window.py", line 3, in &lt;module&gt;
      w = gtk.Window()
  NameError: name 'gtk' is not defined
  </code></pre>
  
  <p>To get it to work, I have to also import (er, reimport) gtk in the module like so:</p>
  
  <pre><code>import gtk
  
  w = gtk.Window()
  w.connect('destroy', lambda w: gtk.main_quit())
  l=gtk.Label('Hello')
  w.add(l)
  </code></pre>
  
  <p>Why should I have to import gtk more than once? Does that mean that I have 2 "gtk's" in memory?</p>
  
  <p>Do I have to import everything within each module that I need within that module?</p>
  
  <p>I know each module has it's own namespace, but I thought it also inherited the "globals" including imported module from the calling program.</p>
  
  <p>I had been under the impression the from module import * is like cutting and pasting the code right into that location. Is there another way to do that?</p>
  
  <p>Help is greatly appreciated.</p>
  
  <p>Narnie</p>