Any way to not create .pyc files?

Lonnie Princehouse finite.automaton at gmail.com
Thu Jun 9 13:14:03 EDT 2005


In short:

Is there any way to run Python WITHOUT trying to create .pyc files (or
.pyo) or to have Python not attempt to import the .pyc files it finds?

Reason:

We have a site-specific package installed on a network drive[1].  When
anyone with write access imports this package, the network drive gets
spammed with .pyc files.

If these .pyc files exist, they appear to cause problems when other
users' Python interpreters use them instead of the .py files.  (I know,
they *should* work, but they don't).  This may have something to do
with the fact that all of these users (on Windows) have the network
drive mapped to arbitrary drive letters.  I don't know.

PEP 304 would have helped, but it appears to be deceased.  What I
really want is a command line option

I'm going to have to cobble together a work-around, like having
imported modules delete their own .pyc files immediately after import,
but it would be really nice to have a /good/ way of not using .pyc...

(footnotes)

[1] Because it's an administrative nightmare to distribute code updates
to dozens of non-technical users




More information about the Python-list mailing list