How to avoid *.pyc files?
Your project directories are littered with .pyc files. How to tell the interpreter to stop creating them?
Since Python 2.6:
“Python can now be prevented from writing
.pyo files by supplying the
-B switch to the Python interpreter, or by setting the
PYTHONDONTWRITEBYTECODE environment variable before running the interpreter. This setting is available to Python programs as the
sys.dont_write_bytecode variable, and Python code can change the value to modify the interpreter’s behaviour.” (tip from here)
So I added the following lines to my
# don't create .pyc and .pyo files PYTHONDONTWRITEBYTECODE=True export PYTHONDONTWRITEBYTECODE
Python 3.2 can save
.pyc files in a dedicated subfolder called “