how to kill a process in windows using python
I was looking for a way to simulate python's os.kill() in windows.Finally ended up with the following code. I tried using win32api also.
handle = subprocess.Popen("someprocess here", shell=False)
subprocess.Popen("taskkill /F /T /PID %i"%handle.pid , shell=True)
Posted by metazin on August 10, 2008 at 08:06 AM IST #
Hi,
I posted an alternate method...
http://metazin.wordpress.com/2008/08/09/how-to-kill-a-process-in-windows-using-python/
Thought it might be useful for you.
Posted by metazin on August 10, 2008 at 08:11 AM IST #
I ended up doing
import os
os.system("taskkill /im NameOfTheExe.exe /f")
Posted by Francis Cloutier on May 07, 2009 at 12:10 AM IST #