need to generate .pyc files

Ed Miller (ed@netcom8.netcom.com)
Fri, 29 Apr 1994 00:56:08 GMT

I'm working on a project that has produced a number of python
modules. These modules get installed into a lib directory; they
are imported by python scripts in a bin directory. Users of these
programs do not have write permission in these directories. This
means that the .py modules in the lib directory do not
automaticly produce .pyc files when they are imported by the
python scripts.

I really like the "import generates .pyc when necessary" feature
for development as it optimizes performance without taking away
the usefulness (to developers) of interpreted code. For
distribution of complete systems, however, it would be handy to
be able to generate the .pyc from a make file (i.e., without
actually executing code which may cause side effects, etc). Is
this possible in python?

Further, I wonder if it is possible to generate a "compiled"
version of python scripts.

Thanks,

Ed Miller
ed@netcom.com