import helloWorld works in Unix but not Windows
<p>A book on Python that I'm reading gives the following example of how to import a module at the interactive prompt:</p>

<pre><code>&gt;&gt;&gt; import helloWorld
</code></pre>

<p>This works fine in my Unix terminal, but when I try this same command at an interactive session under Windows, I either get a syntax error or the module can't be found. I have tried putting the full path of the module to no avail, and I have tried launching Python after first changing to the folder containing this module, but no luck. I even moved the "helloworld.py" file to the "C:\Python27" folder.</p>

<p>I am baffled because the book shows this command working in a Windows command prompt.</p>

<p>Python defaults to using a case-sensitive import, even on Windows. The Windows file API is case insensitive [1], but Windows filesystems are case preserving, which makes it possible to implement a case-sensitive import [2]. When Python tries to import <code>helloWorld</code>, it searches <code>sys.path</code> for packages and files named "helloWorld" plus any of the allowed extensions (e.g. .py, .pyc, .pyo, .pyd). The base filename without the extension has to match the exact case of the imported name. The case of the file extension itself is ignored.</p>

<p><sup>
[1] The object manager's old (i.e. NT 3.x and 4.x) ability to do case-sensitive lookups can be enabled via a registry setting. Then <code>CreateFile</code> and <code>FindFirstFile</code> can be called with a flag to enable case-sensitive lookups.<br>
[2] Except if multiple files in a directory differ only by case. Handling that requires [1].
</sup></p>

python windows import