Why don't I get a .pyc file?

Jeff Kunce kuncej at mail.conservation.state.mo.us
Mon Aug 21 11:26:49 EDT 2000


Rick Pasotto <rickp at telocity.com> wrote in message
news:slrn8prjl1.21e.rickp at tc.telocity.com...
> I'm running linux, python 1.5.2.
> Isn't a .pyc file supposed to be automatically created whenever
> I run a .py file? Why don't I get one for the program I wrote?

As the others said, The .pyc is normally generated on *import* from a .py
file.

*But*, if you don't have write permissions on the directory
containing the .py file, the import will work but no .pyc will be created.

This situation can happen easily with python applications that are
launched by a CGI script. The web user usually doesn't have write
permission to the code directories, the .pyc's never get generated,
and performance suffers.

  --Jeff





More information about the Python-list mailing list