[Twisted-Python] spawnProcess under Win32

Igor Kravtchenko igor at mekensleep.com
Mon Aug 14 09:15:55 EDT 2006


I had recently to use the Process protocol of Twisted (win32eventreactor)
to launch some applications and grab their output.

It works well, the only problem I have is Twisted always opens a DOS 
Since I receive the output and treat them myself, the DOS console stays 
But in fact, I would never want this console to appear on screen.

I've looked at the way Twisted creates a process under Win32 and I've 
that it uses the CreateProcess() function.  The problem is it doesn't 
mention any
creation flags (i.e.: it just passes 0) whereas here, we would need to pass
DETACHED_PROCESS to avoid a new console to be created.

What I've done is merely to add an optional win32flags argument to the 
method in win32eventreactor.py as follow:


I would be interested to know what do you think about this?
Does it seem to you a good idea?



More information about the Twisted-Python mailing list