All answers for the Run-> Run option go with the "/ K" cmd switch, so the terminal remains open or "-i" for python.exe, so python forces the interactive mode - like to save for observation.
However, in cmd /k you need to type exit to close it, in python -i - quit() . If it prints too much for your liking (for me it is mandatory :), the Run command to use is
cmd /k C:\Python27\python.exe "$(FULL_CURRENT_PATH)" & pause & exit
C:\Python27\python.exe is obviously the full path to your python installation (or just python if you want to go with the first executable in your user path).
& - unconditional execution of the next command in Windows - unconditional, since it is executed independently of the RC of the previous command ( && is "and" - is executed only if the previous completed successfully, || - "or").
pause - prints "Press any key to continue ...". and waits for any key (if necessary, the output can be suppressed).
exit - well, enter exit for you :)
So, at the end, cmd starts python.exe , which executes the current file and saves the open window, pause waits for you to press any key, and exit , finally close the window as soon as you press that any key.
Todor Minakov Nov 08 '17 at 16:44 2017-11-08 16:44
source share