Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/visual-studio-code/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Debugging 不同文件的VSCode启动文件调试配置_Debugging_Visual Studio Code_Visual Studio Debugging - Fatal编程技术网

Debugging 不同文件的VSCode启动文件调试配置

Debugging 不同文件的VSCode启动文件调试配置,debugging,visual-studio-code,visual-studio-debugging,Debugging,Visual Studio Code,Visual Studio Debugging,我正在使用VSCode调试Python文件。我有两个脚本,比如说a.py和b.py。这两个文件使用不同的参数。我希望以这样的方式配置launch.json,如果我运行a.py,它应该输入相应的参数,并为其他文件输入相同的参数。但是,启动文件中没有if语句。如果我写两个配置,它只是按顺序运行它们。我的launch.json应该是什么样子?这是我的第一次尝试 { // Use IntelliSense to learn about possible attributes. // Hover to v

我正在使用VSCode调试Python文件。我有两个脚本,比如说
a.py
b.py
。这两个文件使用不同的参数。我希望以这样的方式配置
launch.json
,如果我运行
a.py
,它应该输入相应的参数,并为其他文件输入相同的参数。但是,启动文件中没有if语句。如果我写两个配置,它只是按顺序运行它们。我的
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: Current File",
        "type": "python",
        "request": "launch",
        "program": "${WorkspaceFolder}/src/data_processing/main.py",
        "console": "integratedTerminal",
        "env": {
            "PYTHONPATH": "${workspaceRoot}"
        },
        "args": [
            "/home/gokberk/Desktop/filtered_data",
            "--gdc",
            "gdc-client",
            "--no-download",
            "--manifest",
            "/home/gokberk/Desktop/filtered_data/gdc_manifest.2021-05-26.txt",
            "--source-slides-folder",
            "/home/gokberk/Desktop/filtered_data"
        ]
    },
    {
        "name": "Python: Current File",
        "type": "python",
        "request": "launch",
        "program": "${WorkspaceFolder}/src/training.py",
        "console": "integratedTerminal",
        "env": {
            "PYTHONPATH": "${workspaceRoot}"
        },
        "args": [
            "--input-data-folder",
            "/home/gokberk/Desktop/filtered_data",
            "--alpha",
            "0.2",
            "--beta",
            "0.2",
            "--max-bag-size",
            "50",
            "--underlying-model-type",
            "resnet18",
            "--pretrained",
            "--no-download",
            "--source-slides-folder",
            "/home/gokberk/Desktop/filtered_data"
        ]
    }
]
}