[python-win32] How do I re-assign stdin and stdout

Greg Baryza baryza at intersystems.com
Fri Jul 23 18:53:40 CEST 2004


Sorry for the newbie question, but...

So far I have been creating scripts that automate command invocations and 
start up Windows apps just fine.  Now, however, I wanted automate some 
Perforce commands.  Perforce has an option that takes writes its command 
output as a marshaled Python dictionary.  This requires me to route stdout 
to a file.

I have created a file using win32file and gotten back a file handle.  I 
have assigned that file handle to the hStdOutput item in STARTUPINFO.  I 
have passed the STARTUPINFO to the win32process.CreateProcess method.  Yet, 
the output does not get written to the file.

I have tested various combinations of create and sharing options, but 
nothing seems to work.  There is obviously some detail I am missing.  Can 
someone give me the nudge I need to get over this hurdle?

TIA

<G>



More information about the Python-win32 mailing list