I'm trying to run python scripts through the sublime build system (Sublime Text). I want built to start terminal, execute the program and wait till press any keys.
{
"shell_cmd": "start cmd.exe @cmd /c python -u \"$file\" && echo. && pause",
"file_regex": "^(..[^:]*):([0-9]+):?([0-9]+)?:? (.*)$",
"working_dir": "${file_path}",
"selector": "source.python",
"shell": "true"
}
The above code executes but it terminates as soon as it completes even though pause is added. Using /k terminal stays on screen but then we have manually close it instead of pressing any key.
How to configure shell script so that it will run the code in terminal and end when a key is pressed.
"@start python -u \"$file\" & echo. & pause".shell_cmdis opening cmd just cmd instance. BTW I tried your command still pausing.pausecommand, your comment above is complaining that it is pausing. Now unless I'm incapable of understanding the basic mechanics of this task, it seems to me as if it has worked. Please try to properly explain the task you're trying to perform, what exactly is happening when you perform it, what exactly you'd like to happen instead, why you're complaining about not wanting to use a file, when you posted a command using a file, how user input is relevant"cmd": ["python", "$file"]. The executed output will be shown at bottom of Sublime; if there is an input in a python file, we can't take it through this build system."cmd": ["python", "$file"]executes the python file in cmd, then why are you using"shell_cmd": "start cmd.exe @cmd /c python -u \"$file\"". When you use"cmd":or"shell_cmd":that opens the shell, i.e.cmd.exe. So once that is open you are using a built-incmd.execommand,startto start a secondcmd.exesession passing it the arguments@cmd /c python -u "$file". So the third cmd.exe command is invoked and is passed the following arguments,python -u "$file. Do you see what I mean now? you appear to be running threecmd.exeinstances, just to run apythonscript!