pyc files located elsewhere?

Josiah Carlson jcarlson at uci.edu
Sat Oct 16 11:45:11 EDT 2004


> I would like it if my .pyc files could be in a subdir of the app root
> if possible.  I would have to make sure that the subdir structure
> underneath matched the structure of the app itself.
> 
> I would also consider having each package directory have its own PYC
> directory and the compiled files could go in there even.
> 
> So, can I feed a prefix to the system that checks for and creates .pyc
> files somehow?  My review of the Pydocs for related compilation issues
> didn't seem to turn up an answer.

I don't know if it is possible to automatically write to a different
path, but I /think/ one can /turn off/ writing .pyc files, but it would
necessarily make running the script slower (you don't get cached .pyc
files, so every import requires a py->ptc compilation).

 - Josiah




More information about the Python-list mailing list