vscode中launch.json


描述

简单的一键F5运行当前文件。

样例

{
    // 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": "${workspaceFolder}",
            "args": [],
            "pythonPath": "${command:python.interpreterPath}"
        }
    ]
}

常用

"cwd":执行代码的路径。
"args":参数。["--input", "", "--output", ""]
"pythonPath": "${command:python.interpreterPath}" //终端中的python。
也可以直接设置为conda虚拟环境中的python(python.exe的绝对路径)


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM