vscode对python项目进行debug的launch.js

vscode对python项目进行debug的launch.js

其中:name,request不用改,type是代码类型,program是运行的文件的位置,cwd这里是整个项目所在地址,这样可以调用项目下的文件

{
    // 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",
            "cwd": "${fileDirname}" #这里也可以直接将绝对路径写在这里
        }
    ]
}

版权声明:本文为Perfect_Accepted原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。