[Python-il] controlling the generation of pyc files
shai at platonix.com
Wed Mar 3 12:06:24 IST 2010
On Wednesday 03 March 2010, Amit Dor-Shifer wrote:
> Hi all.
> A process of mine executes a python program, and fails because the
> python program, being invoked for the first-time, attempts to generate
> .pyc files in a directory where it has no write permissions.
> I want to guarantee that pyc files are already present when the process
> executes the program, or, if that's not feasible, to force the program
> not to generate them.
> 2. use the 'distutils' framework.
The simple solution seems to be: Make sure those .pyc files are created as
part of installing your python program. Distutils can do this for you, but you
can also do it "manually" by importing the modules.
More information about the Python-il