如下所示,很简单 python 代码,就三个 print 语句,我在第 2 个 print 语句设置了断点(红色圆点),但是一按 F5 键,整个程序还是全部执行了,断点根本没有生效。
print(1)
print(2)
print(3)
我的 launch.json 中的相关内容如下(${config:python.pythonPath} 环境变量在 setting.json 文件中已经设置为 python.exe 所在的路径了),不知是否正确,请问大家为了实现断点调试,都设置了哪些文件和参数呢?
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},
print(1)
print(2)
print(3)
我的 launch.json 中的相关内容如下(${config:python.pythonPath} 环境变量在 setting.json 文件中已经设置为 python.exe 所在的路径了),不知是否正确,请问大家为了实现断点调试,都设置了哪些文件和参数呢?
"version": "0.2.0",
"configurations": [
{
"name": "Python",
"type": "python",
"request": "launch",
"stopOnEntry": true,
"pythonPath": "${config:python.pythonPath}",
"program": "${file}",
"cwd": "${workspaceRoot}",
"env": {},
"envFile": "${workspaceRoot}/.env",
"debugOptions": [
"WaitOnAbnormalExit",
"WaitOnNormalExit",
"RedirectOutput"
]
},