stdout custom

Gabriel Genellina gagsl-py2 at
Tue Mar 18 02:16:24 CET 2008

On 17 mar, 19:43, castiro... at wrote:

> Can I allocate a second console window, so I can place certain output
> to that directly, and leave the original streams alone?  I tried some
> things in subprocess (Py 3a3 /WinXP) but they failed.  I don't know if
> it's supposed to be possible though, so I didn't press very hard or
> keep the code.  If it is, I can go repro where it went south.  Is it?

Have you tried using the creationflags argument to subprocess.Popen?
Specially the CREATE_NEW_CONSOLE flag. See the Microsoft documentation
for CreateProcess at
(Note that a process can be attached at most to one console)

If your goal is to output some debug information, try using
OutputDebugString + the DebugView utility from

Gabriel Genellina

More information about the Python-list mailing list