Python - JSON

Utilizar Debugpy

# Instalación
python -m pip install debugpy

# Lanzar python
python -m debugpy --wait-for-client --listen 0.0.0.0:5678 app.py

Conectar mediante VS Code

Requiere tener instalada la extensión de VS Code Python Debugger{:target=“_blank”} y configurar el fichero launch.json. Será necesario crear uno si no existe ya.

{
    // Use IntelliSense to learn about possible attributes.
    // Hover to view descriptions of existing attributes.
    // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python Debugger: Debugpy",
            "type": "debugpy",
            "request": "attach",
            "connect": {
                "host": "localhost",
                "port": 5678
            },
            "pythonArgs": ["-Xfrozen_modules=off"],
            "pathMappings": [
                {
                    "localRoot": "/dir/src/local",
                    "remoteRoot": "/dir/src/local"
                }
            ]
        }
    ]
}