美文网首页
win10下 vscode配置launch.json文件,设置相

win10下 vscode配置launch.json文件,设置相

作者: 侯明昊啦啦啦 | 来源:发表于2020-03-07 16:59 被阅读0次

    1.创建launch.json文件

    通过调试配置项配置的

    image

    2.编辑launch.json

    在configuration中使用参数"cwd": "${fileDirname}",这样在debug时可以切换到当前文件所在的目录,使用相对路径。

    
    {
    
        // 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",
    
                "stopOnEntry": false,
    
                "pythonPath": "D:\\Users\\mas\\AppData\\Local\\Programs\\Python\\Python37\\python.exe",
    
                "program": "${file}",
    
                "cwd": "${workspaceRoot}",
    
                "env": {},
    
                "envFile": "${workspaceRoot}/.env",
    
                "debugOptions": [
    
                    "WaitOnAbnormalExit",
    
                    "WaitOnNormalExit",
    
                    "RedirectOutput"
    
                ]
    
            }
    
        ]
    
    }
    
    

    相关文章

      网友评论

          本文标题:win10下 vscode配置launch.json文件,设置相

          本文链接:https://www.haomeiwen.com/subject/beocdhtx.html