Hi, I'd like to start a program, run it for a while, then terminate
it. I can do this on linux, but I'm new to working with windows.
Here's my script:
from subprocess import Popen
from time import sleep
import win32api
war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"])
sleep(30)
print "slept for 30"
print win32api.Termin ateProcess(int( war3game._handl e),-1)
#print
ctypes.windll.k ernel32.Termina teProcess(int(w ar3game._handle ),-1)
print "terminated process"
Here's the output:
slept for 30
Traceback (most recent call last):
File "C:\Python24\wa rcraft\runwar3. py", line 7, in ?
print win32api.Termin ateProcess(int( war3game._handl e),-1)
error: (5, 'TerminateProce ss', 'Access is denied.')
I'm logged in as adminstrator. Does anyone know how to fix this
problem?
Thanks for your time,
Tom
it. I can do this on linux, but I'm new to working with windows.
Here's my script:
from subprocess import Popen
from time import sleep
import win32api
war3game = Popen(["C:\Program Files\Warcraft III\Frozen Throne.exe"])
sleep(30)
print "slept for 30"
print win32api.Termin ateProcess(int( war3game._handl e),-1)
ctypes.windll.k ernel32.Termina teProcess(int(w ar3game._handle ),-1)
print "terminated process"
Here's the output:
slept for 30
Traceback (most recent call last):
File "C:\Python24\wa rcraft\runwar3. py", line 7, in ?
print win32api.Termin ateProcess(int( war3game._handl e),-1)
error: (5, 'TerminateProce ss', 'Access is denied.')
I'm logged in as adminstrator. Does anyone know how to fix this
problem?
Thanks for your time,
Tom
Comment