Question: spawn and redirection

anton muhin antonmuhin at rambler.ru
Fri Feb 13 10:58:53 EST 2004


Ladvánszky Károly wrote:
> On Windows, what is the proper way to spawn an executable and redirect its
> stdout and stderr.
> Thanks for any help,
> 
> Károly
> 
> 


os.spawnv(os.P_NOWAIT, r'c:\WINNT\system32\cmd.exe', ('/C dir > dir.txt',))

does a trick for me.

regards,
anton.



More information about the Python-list mailing list