[Python] Any way to prevent pycache from creating pyc files while using VSCode debugger and...

Discussão em 'Python' iniciado por Stack, Março 26, 2025.

  1. Stack

    Stack Membro Participativo

    I am currently working on a Python project using the latest version on VSCode on Ubuntu 24.04.

    When I run my project without using the debugger

    python3 -B Main.py


    I don't get any .pyc files created, which is fine.

    However, when launching the debugger using the following launch.json file

    {
    "version": "0.2.0",
    "configurations": [

    {
    "name": "Run project in Debug Mode",
    "type": "debugpy",
    "request": "launch",
    "program": "Main.py",
    "args": ["-B"]
    }
    ]
    }


    I get pycache .pyc files created accross the project packages.

    Is there a way to get the -B argument to work in a launch.json file ?

    Thanks

    Continue reading...

Compartilhe esta Página