Killing processes is involved under Windows. The Windows API function
TerminateProcess (in Win32all for Python, or call it with the ctypes module)
will do it, but it does just that, kills the process dead with no oportunity
to clean up. It can leave all sorts of clutter around, that requires a
reboot to get rid of. I seem to remember that Richter's book "Advanced
Windows" contained stuff about killing processes. There is an article on
MSDN that details a method that simulates the safe process shutdown that is
done by the Windows Task manager. I can find it if you want.
TomH <tomh(AT)optiscan(DOT)com>
···
-----Original Message-----
From: Stefan Holmgren [mailto:stefan.holmgren@accalon.se]
Sent: Thursday, 18 December 2003 12:31 AM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython-users] Kill a process under Windows?
Hi,
How do I kill a process under windows(XP),
I do a wxExecute() .....ok!
pid = wxExecute(app, wxEXEC_ASYNC)
I tried to use wxKill ..... not working!
result = wxKill(pid, wxSIGKILL)
is there a way to do this, I looked in python doc. and found kill(), but it
was for Unix..
Thanx
Holmis
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
Yes, please, it would be nice if you post a link to that MSDN article..
"Tom Harris" <TomH@optiscan.com> skrev i meddelandet
news:D1CF0387F1A4D51182B600D0B7A7A95F07171E@uluru2.optiscan.com...
Killing processes is involved under Windows. The Windows API function
TerminateProcess (in Win32all for Python, or call it with the ctypes
module)
will do it, but it does just that, kills the process dead with no
oportunity
to clean up. It can leave all sorts of clutter around, that requires a
reboot to get rid of. I seem to remember that Richter's book "Advanced
Windows" contained stuff about killing processes. There is an article on
MSDN that details a method that simulates the safe process shutdown that
is
done by the Windows Task manager. I can find it if you want.
TomH <tomh(AT)optiscan(DOT)com>
From: Stefan Holmgren [mailto:stefan.holmgren@accalon.se]
Sent: Thursday, 18 December 2003 12:31 AM
To: wxpython-users@lists.wxwindows.org
Subject: [wxPython-users] Kill a process under Windows?
Hi,
How do I kill a process under windows(XP),
I do a wxExecute() .....ok!
pid = wxExecute(app, wxEXEC_ASYNC)
I tried to use wxKill ..... not working!
result = wxKill(pid, wxSIGKILL)
is there a way to do this, I looked in python doc. and found kill(), but
it
···
-----Original Message-----
was for Unix..
Thanx
Holmis
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
You can safely terminate process that you start with wxProcess any time you want. Look at wxProcess in the wx demo.
I also have a demo here that monitors the output of running programs and can update a progress bar. It works under linux/windows but MacOSX doesn't support wxExecute yet. I use it to run long running python scripts. Unlike threads, I can cancel them whenever I want.
Look for LongRunningTasks here:
http://staffa.wi.mit.edu/people/kelley/