how to terminate a process on win32?

David Fraser davidf at sjsoft.com
Mon May 24 10:38:02 EDT 2004


Joe Wong wrote:
> Hi,
>  
>  I am developing two app on Windows, one is a GUI using wxPython and the 
> other is like a daemon process. The GUI app will have a start/stop 
> button to control the excution of the daemon. While I know how to use 
> os.popen2() to start my daemon, I can't figure out a way to stop it 
> 'nicely'... Is there anything that I can do?
>  
> Regards,
>  
> -- Wong
>  

You can use the win32process.TerminateProcess function to kill a
process... see the win32 docs

David



More information about the Python-list mailing list