Vscode python debbuger参数与ptvsd\u launch混合

2024-05-16 05:28:21 发布

您现在位置:Python中文网/ 问答频道 /正文

在Vscode中调试python时,我确实设置了启动.json用于将参数传递给具有"args"字段的脚本。在

{
        "name": "Python: Current File (Integrated Terminal)",
        "type": "python",
        "request": "launch",
        "program": "${file}",
        "console": "integratedTerminal",
        "args": [
            //"src\\vhdl\\counter-e.vhd",
            //"src\\vhdl\\counter-rtl-a.vhd"
            "--help"
        ],
},

当我传递特定的参数时,工作正常,但我想检查参数-h或{}(在python脚本中测试它们),调试器会感到困惑并显示ptvsd_launcher.py的帮助,我得到了该脚本的输出,而不是我的脚本,它不会执行:

^{pr2}$

这种行为怎么能逃脱呢?在


Tags: namesrc脚本json参数typecounterargs