vscode 中自己使用的 launch.json 设置
文章目录
默认参数如下:
{// 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 Debugger: Current File with Arguments","type": "debugpy","request": "launch","program": "${file}","console": "integratedTerminal","args": "${command:pickArgs}"}]
}
设置不需要输入参数:
"args": [] // 不需要输入参数
设置使用当前激活的环境:
"python": "${command:python.interpreterPath}" // 使用当前激活的环境
设置程序调试中将哪个路径设置成的项目根目录(相对路径使用该路径作为前置路径):
"cwd": "${workspaceFolder}" // 将工作目录设置为项目根目录,可以自行添加指定路径