Allow "Run Python File in Terminal" to accept script arguments #19810
Labels
area-environments
Features relating to handling interpreter environments
area-terminal
feature-request
Request for new features or functionality
needs community feedback
Awaiting community feedback
We already have the setting
"python.terminal.launchArgs"
, which pass arguments to the python interpreter.This simple request is to allow arguments to be passed to the python file (script) that is running.
Examples (existing):
If we configure:
"python.terminal.launchArgs": ["-i"]
and use the command "Run Python File in Terminal"it will launch:
python -i script.py
If we configure:
"python.terminal.launchArgs": ["-m", "IPython", "-i" ]
and use the command "Run Python File in Terminal"it will launch:
python -m IPython -i script.py
Example (requested):
To have a different setting, like, for instance,
"python.terminal.scriptArgs"
which would pass the arguments to the script when using the command "Run Python File in Terminal", not to the interpreter, i.e.:"python.terminal.scriptArgs": ["arg1", "arg2"]
would make the command launchpython script.py arg1 arg2
Related:
The following topics make related requests, but not as simple as this one.
#11812 => Requests more complex configuration
#19784 => Requests the arguments to be passed at run time in the debug launch.
Also see this comment
The text was updated successfully, but these errors were encountered: