[Tutor] .pyc files and executables?

alan.gauld@bt.com alan.gauld@bt.com
Thu, 16 Aug 2001 15:56:09 +0100


> So, Alan, I believe you're correct.  Python will use .pyc files for
> modules that are imported, but not for the main program.

Thats a relief, my recent track record hasn't been too good!

> So, I might look into mod-python, if I can talk my webmasters into
> giving me access to their configured Apache code.  I think I'll need
> that in order for the module to compile properly.

The big gain in mod-py is not the compilation issue but the fact 
that the interpreter is already running - at least I assume thats 
the gain...

For the comilation bit if your program consists of:

#! /env/python
import my_real_program

my_real_program.main()


Then the compilation overhead is minimal and it pulls in the pyc 
for the bulk of the program...
But I suspect that compared to the startup time of python itself 
thats a minimal saving.

Alan g