Windows2000 console control

Mark Hammond MarkH at ActiveState.com
Thu Jul 5 00:18:45 EDT 2001


Ralph Bruno wrote:

> I first tried win32process.CreateProcess, which according to the docs
> has a 'CREATE_NO_WINDOW' setting to hide the console, but this gave me


win32con.CREATE_NO_WINDOW.  I've made the docs clearer.

> I've tried win32pipe, but this doesn't seem to allow me to get the
> process handle, although I can get at the console output.


If you don't need to kill the process, then popen in a thread should 
work.  The process has terminated when read() returns an empty string. 
Another thread can be in this blocking read, and notify your main code 
when the process has terminated.

If you need the process handle to be able to kill it, then you need to 
go down the CreateProcess route, doing the standard handle redirection 
manually.

Mark.




More information about the Python-list mailing list