Disabling creation of .pyc files?

Skip Montanaro skip at pobox.com
Wed Feb 13 12:03:43 EST 2002


    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.

-- 
Skip Montanaro (skip at pobox.com - http://www.mojam.com/)




More information about the Python-list mailing list