Changing the directory where .pyc files are created

后端 未结 4 1968
天涯浪人
天涯浪人 2020-12-08 19:05

Is there a way to change the directory where .pyc file are created by the Python interpreter? I saw two PEPs about that subject (0304 and 3147), but none seems

4条回答
  •  死守一世寂寞
    2020-12-08 19:40

    There's no way to change where the .pyc files go. Python 3.2 implements the __pycache__ scheme whereby all the .pyc files go into a directory named __pycache__. Python 3.2 alpha 1 is available now if you really need to keep your directories clean.

    Until 3.2 is released, configure as many tools as you can to ignore the .pyc files.

提交回复
热议问题