VS Code调试Python相关的问题

鸽鸽的书房 / 2023-08-15 / 原文

  • VSCode启动Debug模式调试带参数的python文件:
    https://blog.csdn.net/weixin_39329055/article/details/119530587

  • 单步调试进入外部文件:launch.json中写入以下:

{
    // 使用 IntelliSense 了解相关属性。 
    // 悬停以查看现有属性的描述。
    // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: 当前文件",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": false,
            "purpose": ["debug-in-terminal"]
        }
    ]
}