[Tutor] python 2.3.4, how to use os.system and collect it's output to a file.

xDog Walker thudfoo at gmail.com
Tue Aug 2 23:25:25 CEST 2011


On Tuesday 2011 August 02 08:40, Thirupathaiah Gande (tgande) wrote:
> Hi,
>
>
>
> I have Python 2.3.4.
>
> I want to use os.system command and collect a command's  output to a
> file. But it is not collecting all the output. It is truncating..
>
>
>
> Code is as below.
>
>
>
> cmd = "%s rl -comp %s@%s/%d  >> %s" % (C_CMD, i, branch, x,
> temp_acme_rl_log)
>
> cmd_res = os.system( cmd )
>
>
>
> What I am missing?
>

The stdlib has the commands module just for this sort of thing if your OS is 
Unix.

-- 
I have seen the future and I am not in it.


More information about the Tutor mailing list