Capturing stdout from a console process?

Curtis Jensen cjensen at bioeng.ucsd.edu
Thu Dec 14 19:04:32 EST 2000


Sam Schulenburg wrote:
> 
> I am using <os.system("xcopy c:*.* d: /v")> within a python program to
> copy files from one directory to another under windows NT. When the
> program executes, a new console window is created with the results of
> the xcopy command being displayed in the console window. Is their a way
> to capture this output by python so I can log error messages?
> 
> Sam Schulenburg
> 
> Sent via Deja.com
> http://www.deja.com/

I think os.popen is what you want.

-- 
Curtis Jensen
cjensen at bioeng.ucsd.edu
http://www-bioeng.ucsd.edu/~cjensen/
FAX (425) 740-1451



More information about the Python-list mailing list