vs代码版本:1.29.1(1.29.1)
python版本:3.6.5
{
"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
}
当我测试调试时,我失败了。
说“开始调试之前,您需要选择一个Python解释器”。 但是我实际上选择了一个显示在左下角的版本。
任何部分不正确吗?
答案 0 :(得分:1)
我将其编辑为以下代码,并且可以正常工作!
{
"name": "Python: Current File (Integrated Terminal)",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"stopOnEntry": true
}
答案 1 :(得分:0)
VS Code网站上此处给出的文档可能会有所帮助。您是否尝试过从这里获取参考? https://code.visualstudio.com/docs/python/debugging