为了带入参数调试python 程序,点击了ui界面右上角的debug按钮,配置了lauch.json文件。按照网上搜到的教程添加了"args":
{
// 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": "${file}",
"console": "integratedTerminal",
"justMyCode": true,
"args": [
"--name","Alice",
"--age", "18",
],
}
]
}
但是点击ui界面的debug按钮,发现配置的参数并不起作用。
原因:
在vscode-python
项目的issue和issue里找到答案。
省流:ui界面右上角的debug按钮是一个扩展插件,独立于debug系统,不会读launch.json
可行的使用方法:
"purpose": ["debug-in-terminal"],