Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have a Python Script, running in command line. In some machines ( maybe Linux, I don't know), I can terminate the service by typing CTRL+C. However, I can't do this in my Windows XP machine.

Is there any Python script terminator that I can try on?

share|improve this question

3 Answers 3

up vote 3 down vote accepted

I found the answer.

The command to break a Python script, on a Windows XP machine, is

CTRL+Pause Break
share|improve this answer

If it's a script executing in CMD.EXE or COMMAND.COM, <Ctrl>-<C> will terminate it. It sounds to me like you're running a console-mode application (an EXE), in which case it's very likely that there isn't a keyboard termination character. It'll just depend on what the author of the application coded in.

share|improve this answer
    
It's a python script actually. –  Graviton Jun 6 '09 at 4:13
    
I would think Ctrl+C should work for a Python script on Windows, unless the script catches the KeyboardInterrupt exception. –  David Z Jun 6 '09 at 4:17
    
I agree with David. Have a look in the script, then, to see if they're catching the KeyboardInterrupt exception. –  Evan Anderson Jun 6 '09 at 4:20

Could you use the Task Manager to kill the process manually? I'm not sure if you can do that as a batch job (i.e. for large numbers of processes automatically), but you shouldn't really be killing large numbers of processes automatically, and in any case Task Manager is no less efficient than Ctrl+C.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.