-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow "Run Python File in Terminal" button to be configurable #11812
Comments
yes, at the moment this is a completely useless button. |
I agree here, unless I'm missing something apparently there isn't any way to run a script with arguments through this button/command. One is forced to use the Debug screen launchers which is substantially less convenient. |
@gandhis1, if you think it will be good, please, up vote this |
@luabud, I think we already can pass arguments to python with the setting I've opened this issue to request the same for the script file. |
Yes, good point! And perhaps you meant to reference #19810? |
Yeah, my bad. I updated the link now. |
Another good option would be to add the ability to run currently open file as a module. This is already referenced by #10130 in a slightly different way. Currently there is only a way to set a specific module to be ran.
I think there should be an option to run the currently open file as a module and also set that to be the default behaviour for the "Run Python File" button so that it could be used without starting the debugger. |
Possibly related on Stack Overflow: How can I configure the "Run" button next to the editor tabs in VS Code for Python files? |
I agree with @AntonVucinic and #10130 running files as a module would be useful. When there is a bit of folder hierarchy, the only way to import something is to use modules. This could also be solved with some search/replace in the variables. To give a bash example:
gives
Apologies if this seems like hijacking this issue but #10130 is closed. |
Actually, there might be an easier way to solve this. Afaict from https://code.visualstudio.com/docs/editor/variables-reference#_command-variables, if this extension would define a |
This could be done by linking it to "Run Without Debugging" if we have an easy set up experience for running scripts. Or simply by allowing arguments to be passed to python (e.g. -i) or to the file.
We should also allow for stopping the execution
Related:
#10130
#11036
#12185
#12668
The text was updated successfully, but these errors were encountered: