How to stop python from looking for .py files
<p>I have a system with very little resources (embedded). Because of that I only installed the python .pyo files (=byte compiled &amp; optimized) for my program. Now when such a program runs, python keeps looking for .py files (probably to see if the .pyo needs to be updated). The funny thing is that it does that a lot: 25000 stat64() calls (and 8304 getcwd calls()) in 5 minutes!</p>

<pre><code>getcwd("/tmp", 1026)                = 9
getcwd("/tmp", 1026)                = 9
stat64("MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python2.5/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python25.zip/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python2.5/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python2.5/plat-linux2/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python2.5/lib-tk/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("/usr/local/lib/python2.5/lib-dynload/MyProgram.py", 0xbeb94b0c) = -1 ENOENT (No such file or directory)
stat64("MyProgram.py", 0xbeb94cc8) = -1 ENOENT (No such file or directory)
getcwd("/tmp", 1026)                = 9
stat64("MyProgram.py", 0xbeb94bc4) = -1 ENOENT (No such file or directory)
</code></pre>

<p>How can I prevent python from doing this?</p>
