关于设置Python调试的VSCode问题

2024-03-29 11:47:15 发布

您现在位置:Python中文网/ 问答频道 /正文

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解释器”。 但我实际上选择了左下角的一个版本。你知道吗

有什么零件不正确吗?你知道吗


Tags: 代码name版本noneconfigjsontruerequest
2条回答

VS代码网站上提供的文档可能会有所帮助。你试过从这里得到推荐信吗? https://code.visualstudio.com/docs/python/debugging

我编辑下面的代码,它的工作!!你知道吗

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

相关问题 更多 >