How can I debug Python 3 code in Visual Studio Code?

后端 未结 6 589
没有蜡笔的小新
没有蜡笔的小新 2020-12-15 04:38

I want to debug a project written in Python 3 in Visual Studio Code, but I can\'t seem to find any way of specifying interpreter or Python version in the launch.json file.

6条回答
  •  时光取名叫无心
    2020-12-15 05:19

    To debug Python projects in Visual Studio Code, use the Launch Configuration as below:

            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${cwd}/{filename}.py",
            "args" : [
                "--arg1", "arg1-value",
                "--arg2", "arg2-value",
                "--arg3", "arg3-value"
            ],
            "console": "integratedTerminal"
    

提交回复
热议问题