While debugging in VS Code, I am trying to give command lines but it doesn't take any and it moves directly to input()
. Here len(sys.argv)
is always equal to one.
I saw an old question which was exactly about the same, but it didn't help.
In watch it says len(sys.argv)=1
and it doesn't take any input
Add "args": ["arg1", "arg2", "arg3"]
to your launch.json
if you want to pass some values.
This configuration ensures that sys.argv
will contain the specified arguments when your script runs in the debugger.
Read document about args for more details.