Killing process
- From: "Harlin Seritt" <harlinseritt@xxxxxxxxx>
- Date: 29 Apr 2005 18:03:31 -0700
I am using os.getpid() to get the pid value for a script running. I
store that value (as a string) to a file. Later when I try to kill that
pid (i pull this from the file as a string value) I get errors.
Using the following lines I get the subsequent error.
(pid is a string value)
win32api.TerminateProcess(int(pid), 0)
OR
ctypes.windll.kernel32.TerminateProcess(int(pid), 0)
Errors:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python23\lib\lib-tk\Tkinter.py", line 1345, i
return self.func(*args)
File "vngconsole.py", line 27, in StopVngSvc
win32api.TerminateProcess(int(pid), 0)
error: (6, 'TerminateProcess', 'The handle is invalid.')
How exactly do I kill a pid using a string value?
.
- Follow-Ups:
- Re: Killing process
- From: Peter Hansen
- Re: Killing process
- From: Roger Upole
- Re: Killing process
- Prev by Date: Re: Python site-packages and import
- Next by Date: Re: large dictionary creation takes a LOT of time.
- Previous by thread: python and os.system() failure
- Next by thread: Re: Killing process
- Index(es):
Relevant Pages
|