Visual Studio Code: How debug Python script with arguments

I also noticed that if you run the script by clicking on the debug button that looks like this enter image description here, then the arguments are not passed. However, using Run -> Start Debugging (or its shortcut F5) passed the arguments successfully.


I think the --City and Auckland are used as a single argument. Maybe try separating them like so...

Single argument

    "args": ["--city","Auckland"]

Multiple arguments and multiple values

Such as:

--key1 value1 value2 --key2 value3 value4

Just put them into the args list one by one in sequence:

"args": ["--key1", "value1", "value2", "--key2", "value3", "value4"]