Quantcast
Channel: Active questions tagged visual-studio-code - Stack Overflow
Viewing all articles
Browse latest Browse all 97371

How to pass a list in debug configuration as command line argument in vscode?

$
0
0

I am trying to debug a python file by passing a list as a string in a command-line argument. Normally I will execute the code as follows (which works fine):

python main.py "[0,0,0,0]"

So, in VS code debugger, I specify the arguments as below, which does not work:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "[0,0,0,0]"
             ]
        }
    ]
}

I also tried the following config with "\"[0,0,0,0]\"" and that too fails:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Python: Current File",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "args": [
                "\"[0,0,0,0]\""
             ]
        }
    ]
}

Please help me out.


Viewing all articles
Browse latest Browse all 97371

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>