title: Importing pyw files as modules under Linux
body: <p>I have gotten some code from a colleague of mine written in Python for Windows. He is using several modules where files have the extension mymodule.pyw instead of mymodule.py. This works simply by doing</p>
  
  <blockquote>
    <p>import mymodule</p>
  </blockquote>
  
  <p>even if there is no file called mymodule.py. In Linux (Ubuntu 13.04 in my case) this does not work however. I get error messages of this form:</p>
  
  <blockquote>
    <p>Traceback (most recent call last):
    File "main.pyw", line 27, in 
       import core.main_window</p>
    
    <p>ImportError: No module named main_window</p>
  </blockquote>
  
  <p>simply renaming the module files to .py fixes the issue, but this is not desirable since I would like to use the same software on Windows and Linux.</p>
  
  <p>Why is there this difference in the handling in Python and Windows and what can be done to fix it?</p>
  
  <p>References:
  <a href="https://mail.python.org/pipermail/patches/2001-August/005411.html" rel="noreferrer">I seem to have found the original patch that added pyw support to windows, but with no argument as to why it shouldn't also apply to Linux.</a></p>