不乱于心,不困于情。
不畏将来,不念过往。如此,安好。

vscode 修改 python debug调试工作目录

在vscode launch.json 中,找到对应python配置项,添加”cwd”: “${fileDirname}”

{
    // 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: 当前文件",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "cwd": "${fileDirname}" # 添加该参数
        },
        {
            "type": "pwa-chrome",
            "request": "launch",
            "name": "Launch Chrome against localhost",
            "url": "http://localhost:8080",
            "webRoot": "${workspaceFolder}"
        }
    ]
}
赞(0) 打赏
未经允许不得转载:seo优化_前端开发_渗透技术 » vscode 修改 python debug调试工作目录

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏