Kill a process in windows python 2.5

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

I start the process as follows:

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

This gives me an error saying that the Popen object does not have the kill attribute. Using os.kill (ex.pid, signal.SIGKILL) gives a similar error.

+3
source share
2 answers

Among others, I found two ways:

The latter uses a module subprocessin conjunction with taskkill. First one win32api.TerminateProcess.

+3
source

Popen.kill() Python 2.6. 2.5 taskkill win32api, "MYYN".

0

Source: https://habr.com/ru/post/1792599/


All Articles