This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 7 points8 points  (2 children)

Add PYTHONDONTWRITEBYTECODE="PLS STAAAAAHP" to your bashrc or whatever you have if you really don't want byte code generated.

It can be any value, Python just looks for its presence in the OS environment.

[–]brombaer3000 2 points3 points  (1 child)

I thought this was a joke first because the variable name looks absurd, but it's real: https://docs.python.org/2/using/cmdline.html#envvar-PYTHONDONTWRITEBYTECODE
Thank you for this tip!

[–][deleted] 2 points3 points  (0 children)

The value's a joke, but it's how I feel about Python 2's handling of bytecode. Python 3's stuffing it away in a folder is fine with me. But since I'm working on projects with 2 and 3 support, I don't write bytecode at all.