[Tutor] how to stop a running program in python without closing python interface?

Mark Lawrence breamoreboy at yahoo.co.uk
Mon Feb 13 02:00:02 CET 2012


On 12/02/2012 22:19, Steven D'Aprano wrote:
> Debashish Saha wrote:
>> actually a i ran a progam in python which is sufficiently large . so i
>> want to stop the execution of the program now . how can i do this?
>
> Control-C should work on every operating system. Obviously you have send
> the Ctrl-C to the Python process, not some other application. E.g. if
> you are running your program in a terminal window, bring the terminal
> window to the front so it captures keystrokes and type Ctrl-C.
>
> If you have to kill the Python process from outside, use your operating
> system's standard method for killing processes. E.g. on Windows you
> would type ctrl-alt-del and then select which process to kill from the
> dialog box. On Linux you would use the ps and kill commands.
>
>

At least on Windows Vista ctrl-alt-del brings up a list of options, one 
of which lets you bring up the Task Manager to kill the process and/or 
application.  ctrl-shift-esc brings up the Task Manager directly.

-- 
Cheers.

Mark Lawrence.



More information about the Tutor mailing list