How to kill a process in python 2.5 on windows 64bit platform? -


i have python script opening 3 executable files follows:

aa=subprocess.popen([r"..\location\learning\a.exe"]) bb=subprocess.popen([r"..\location\learning\new\b.bat"]) cc=subprocess.popen([r"..\location\learning\new\b.bat"]) 

all 3 files getting opened. now,next step want kill these 3 opened modules.so, firstly tried kill "aa" follows:

process_terminate= 1 k = ctypes.windll.kernel32klll handle = k.openprocess(process_terminate, false,aa.pid) k.terminateprocess(handle, -1) k.closehandle(handle) 

but after adding these piece of lines 3 modules 'aa','bb' , 'cc' don't gets opened.so,i want know clean solution firstly 3 modules gets executed , after while closed itself. as,i using python 2.5 on windows 64 bit platform kindly suggest solution accordingly.

the process returned subprocess.popen() has terminate() method kill child process since python 2.6. use have upgrade python install or install 2 versions of python in parallel.

but better way find out how can tell process stop , use that. many processes stop when send them standard input or when close pipes popen created.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -