lte*_*e__ 7 visual-studio-code vscode-settings vscode-debugger
我有一个包含多个文件/模块的 Python 项目,我正在尝试调试。我安装了Python 扩展,并在其中放置了一堆断点 - 一些在当前文件中,一些在另一个文件/模块中。当前文件中的断点工作正常,但是,其他文件中的断点则不然。我在设置调试器时缺少一个步骤吗?在 Google 上找不到针对此特定问题的任何内容,教程仅在一个文件中显示调试,并且工作正常。如果我尝试右键单击并转到另一个模块中任何函数的定义,这也可以正常工作,因此项目知道多个模块(我在 VS Code 中打开了整个目录),断点则不然。
Mat*_*att 11
Ran into the same issue. In case you still need to know, this is how I resolved it.
{
// 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: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal"
}
]
}
Run Code Online (Sandbox Code Playgroud)
{
// 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: Current File",
"type": "python",
"request": "launch",
"program": "${file}",
"console": "integratedTerminal",
"justMyCode": false
}
]
}
Run Code Online (Sandbox Code Playgroud)
A screenshot of what the debug screen configuration should now look like:

You can create different configs if you don't want to debug other modules or do things as well.
| 归档时间: |
|
| 查看次数: |
3213 次 |
| 最近记录: |