great tips! thanks!
/stefan
On 8/9/06, Nick <nick.petit(at)gmail.com> wrote:
have a look at popen2, popen3 and popen4 if you want conveniently seperated
data...
popen2 only returns put (stdin) and get (stdout)
popen3 returns put, get and errs (stderr)
popen4 returns put and concatenates gets and errs
put, get, err = os.popen3(sys command, 'r')
for line in err.readlines():
print line
On 8/9/06, Bradley Gabe <withanar(at)stanwinston.com> wrote:
> Woot! Works perfectly, thanks Bernard!
>
> > You might want to look into os.popen() and its various flavors, Brad.
> > This is how I intercept the XSIBATCH output in the Python program that
> > runs on the render farm.
> >
> > Create the pipe object using
> > oPipe = os.popen( command name, 'r' )
> > Then read the output using
> > oPipe.read()
> >
> >
> > Cheers
> > Bernard
> >
> >
> >
> > On 8/8/06, Bradley Gabe <withanar(at)stanwinston.com> wrote:
> > > I'm wondering if this is possible... I need to run os.system() calls
> > > through python, and I need to be able to see the line Python echos as
a
> > > result.
> > >
> > > So for example, if I want to run the command: whoami, I need to get
the
> > > string value that is echoed. The os.system() method itself just
returns
> > > a number describing the status of the command.
> > >
> > > The purpose of this is to help in debugging Apache running mod python,
> > > which is doing strange things regarding permissions.
> > >
> > > Any help or advice appreciated!
> > >
> > > -Brad
> > >
> > > ---
> > > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
> > > unsubscribe xsi
> > >
> > ---
> > Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
body:
> > unsubscribe xsi
>
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
> unsubscribe xsi
>
--
Freelance Pixel Abuser
http://os3d.blogspot.com/
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi