Capturing output from stderr

Doru-Catalin Togea doru-cat at ifi.uio.no
Mon Dec 5 08:36:29 EST 2005


On Mon, 5 Dec 2005, Doru-Catalin Togea wrote:

Found a solution:

 	os.system("some command 1>out.txt 2>err.txt")

> On solaris, I call a program from python with
>
> 	os.system("some command > outputFile.txt" )
>
> This redirects the output of "some command"'s stdout to "outputFile.txt". 
> However I need to redirect or somehow capture the output from "some 
> command"'s stderr to this file too. How can I do that?
>
> Thanks,
> Catalin
>
>
>

-- 

         <<<< ================================== >>>>
         <<     We are what we repeatedly do.      >>
         <<  Excellence, therefore, is not an act  >>
         <<             but a habit.               >>
         <<<< ================================== >>>>



More information about the Python-list mailing list