3

How do i kill a process in windows (xp 32 bits) in python 2.5? Someone on stackoverlow posted on how to import ctypes and do it but I don't have a ctypes module.

I am running the process in the following way-

ex=Execution(cmd)
#do something
ex.proc.kill() 

This gives me an error saying Popen object has no attribute kill. Using os.kill(ex.pid, signal.SIGKILL) gives a similar error.

2 Answers 2

3

Among others, I found two ways:

The latter uses the subprocess module in conjunction with taskkill. The former win32api.TerminateProcess.

Sign up to request clarification or add additional context in comments.

1 Comment

@AlexOkrushko, thanks, it was an old Sun link, edited to link to the hopefully same content on Oracle.
0

Popen.kill() is only available after Python 2.6. For 2.5 and earlier, you can use taskkill or the win32api as mentioned by "The MYYN".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.