Disabling creation of .pyc files?

Philip Swartzleonard starx at pacbell.net
Thu Feb 14 05:33:48 EST 2002


Skip Montanaro || Wed 13 Feb 2002 09:03:43a:

> 
>     Dominic> ... I'm a bit annoyed by the fact that for every .py file
>     I'm Dominic> importing, Python automatically creates a
>     corresponding .pyc Dominic> file, which persists after my program
>     exits. 
> 
> It's there for your benefit (imports are faster when up-to-date .pyc
> files are present because the compilation step is avoided), but yes,
> you can disable it by simply making the directory containing the .py
> files read-only.
> 

Does this work under windows? I just set a folder read-only (it is an 
option, but FIAK the 'properties' window might lie or cheat regarging the 
underling attrib calls, but...), and it didn't seem to prevent me from 
adding files or changing names...

-- 
Philip Sw "Starweaver" [rasx] :: www.rubydragon.com



More information about the Python-list mailing list