On Feb 16, 11:37 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Feb 16, 4:07 pm, [EMAIL PROTECTED] wrote:
>
>
>
> > On Feb 16, 3:28 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
> > > That's ok inside the same process, but the OP needs to use it "from a
> > > subprocess or spawn".
>
On Feb 16, 4:07 pm, [EMAIL PROTECTED] wrote:
> On Feb 16, 3:28 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
>
>
> > That's ok inside the same process, but the OP needs to use it "from a
> > subprocess or spawn".
> > You have to use something like tee, working with real file handles.
>
> I'm
On Feb 16, 3:28 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
>
> That's ok inside the same process, but the OP needs to use it "from a
> subprocess or spawn".
> You have to use something like tee, working with real file handles.
>
I'm not particularly familiar with this, but it seems to me
En Fri, 16 Feb 2007 14:04:33 -0300, Bart Ogryczak <[EMAIL PROTECTED]>
escribió:
> On Feb 14, 11:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>> I'm looking for a way to output stdout/stderr (from a subprocess or
>> spawn) to screen and to at least two different files.
>
> I'd derive
On Feb 14, 11:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> Hello,
>
> I searched on Google and in this Google Group, but did not find any
> solution to my problem.
>
> I'm looking for a way to output stdout/stderr (from a subprocess or
> spawn) to screen and to at least two different fil
On Feb 15, 5:48 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Thu, 15 Feb 2007 19:35:10 -0300, Matimus <[EMAIL PROTECTED]> escribió:
>
>
>
> >> I think you should be able to use my or goodwolf's solution with the
> >> subprocess module. Something like this (untested):
>
> >> [code]
> >> c
En Thu, 15 Feb 2007 19:35:10 -0300, Matimus <[EMAIL PROTECTED]> escribió:
>> I think you should be able to use my or goodwolf's solution with the
>> subprocess module. Something like this (untested):
>>
>> [code]
>> class TeeFile(object):
>> def __init__(self,*files):
>> self.files = f
On Feb 15, 8:51 am, "Matimus" <[EMAIL PROTECTED]> wrote:
> On Feb 15, 7:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote:
>
> > > like this?
>
> > > class Writers (object):
>
> > > def __init__(self, *writers):
> > >
On Feb 15, 7:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]>
wrote:
> On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote:
>
>
>
> > like this?
>
> > class Writers (object):
>
> > def __init__(self, *writers):
> > self.writers = writers
>
> > def write(self, string):
> >
On Feb 14, 6:52 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> wrote:
> En Wed, 14 Feb 2007 19:28:34 -0300, [EMAIL PROTECTED]
> <[EMAIL PROTECTED]> escribió:
>
> > I'm looking for a way to output stdout/stderr (from a subprocess or
> > spawn) to screen and to at least two different files.
>
> Look at
On Feb 14, 5:10 pm, "goodwolf" <[EMAIL PROTECTED]> wrote:
> like this?
>
> class Writers (object):
>
> def __init__(self, *writers):
> self.writers = writers
>
> def write(self, string):
> for w in self.writers:
> w.write(string)
>
> def flush(self):
>
En Wed, 14 Feb 2007 19:28:34 -0300, [EMAIL PROTECTED]
<[EMAIL PROTECTED]> escribió:
> I'm looking for a way to output stdout/stderr (from a subprocess or
> spawn) to screen and to at least two different files.
Look at the tee command. If you control the subprocess, and it's written
in Python,
like this?
class Writers (object):
def __init__(self, *writers):
self.writers = writers
def write(self, string):
for w in self.writers:
w.write(string)
def flush(self):
for w in self.writers:
w.flush():
import sys
logfile = open('log
I took a look around and I couldn't find anything either. I will be
keeping an eye on this thread to see if someone posts a more standard
solution. In the mean time though, I will offer up a potential
solution. Duck typing is your friend. If you are only using the write
method of your files, it can
Hello,
I searched on Google and in this Google Group, but did not find any
solution to my problem.
I'm looking for a way to output stdout/stderr (from a subprocess or
spawn) to screen and to at least two different files.
eg.
stdout/stderr -> screen
stdout -> log.out
stderr -> log.err
and if pos
15 matches
Mail list logo