python - 关于VSCode设置Python调试的一个问题

标签 python visual-studio-code

vs代码版本:1.29.1(1.29.1)

python 版本:3.6.5


启动.json:

     {
        "name": "Python",
        "type": "python",
        "pythonPath":"${config.python.pythonPath}", 
        "request": "launch",
        "stopOnEntry": true,
        "console": "none",
        "program": "${file}",
        "cwd": "${workspaceRoot}",
        "debugOptions": [
            "WaitOnAbnormalExit",
            "WaitOnNormalExit",
            "RedirectOutput"
        ],
        "env": {"name":"value"}
    }

工作区设置:

     {
"python.pythonPath": "/usr/local/opt/python/libexec/bin/python",
"python.linting.pylintEnabled": true
     }

Extensions I downloaded.


当我测试调试时,我失败了。

result


据说“你需要在开始调试之前选择一个Python解释器”。 但我实际上选择了一个版本显示在左下角。

哪里不对?

最佳答案

我按照下面的代码进行编辑,它有效!!

{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true
}

关于python - 关于VSCode设置Python调试的一个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53735230/

相关文章:

Python计算每一行的MSE

python - Scrapy - 解析页面以提取项目 - 然后跟踪并存储项目 url 内容

python - 安装Scrapy和pyOpenSSL时cmd exit status 1错误

javascript - Eslint 或 prettier 在 vscode 的行尾添加 2 个分号

node.js - 在 PATH 上找不到运行时 'node' - Visual Studio Code 和 Node.js

python - NumPy 最小/最大就地赋值

python - 具有排列签名的堆算法

visual-studio-code - 如何在 Visual Studio 代码中在行尾添加分号

visual-studio-code - 使用 Visual Studio Code 设置 Flutter

python - 如何使用 Visual Studio 2017 连接到 Jupyter 笔记本