command line arguments in python debugging

35

The steps are shown in the image linked here:

https://i.stack.imgur.com/Hx5tf.png

Go to debug mode in VS Code
Click on the settings icon (gear icon). If it does not exist this will create a launch.json
In the json, in any of the configuration, add the args json parameter:
{
    "name": "Python: Terminal (integrated)",
    "type": "python",
    "request": "launch",
    "stopOnEntry": true,
    "pythonPath": "${config:python.pythonPath}",
    "program": "${file}",
    "cwd": "",
    "console": "integratedTerminal",
    "env": {},
    "args": [
        "input2.csv",
        "output2.csv"
    ],
    "envFile": "${workspaceFolder}/.env",
    "debugOptions": [],
    "internalConsoleOptions": "neverOpen"
}

Comments

Submit
0 Comments