Edward Elliott wrote:
> AndyL wrote:
>
>>Edward Elliott wrote:
>>
>>>And if the script runs somewhere that stderr is likely to disappear:
>>>
>>>prog1 = subprocess.Popen(['prog1'], stdout=file1,
>>>stderr=subprocess.STDOUT)
>>
>>Forgot to mention before that the main motivation is to have the same
AndyL wrote:
> Edward Elliott wrote:
>> And if the script runs somewhere that stderr is likely to disappear:
>>
>> prog1 = subprocess.Popen(['prog1'], stdout=file1,
>> stderr=subprocess.STDOUT)
>
> Forgot to mention before that the main motivation is to have the same
> code on bot Linux and M$ pl
Edward Elliott wrote:
> Steven Bethard wrote:
>
>>import subprocess
>>
>>file1 = open('file1', 'w')
>>prog1 = subprocess.Popen(['prog1'], stdout=file1)
>
>
> And if the script runs somewhere that stderr is likely to disappear:
>
> prog1 = subprocess.Popen(['prog1'], stdout=file1, stderr=subproc
Steven Bethard wrote:
> import subprocess
>
> file1 = open('file1', 'w')
> prog1 = subprocess.Popen(['prog1'], stdout=file1)
And if the script runs somewhere that stderr is likely to disappear:
prog1 = subprocess.Popen(['prog1'], stdout=file1, stderr=subprocess.STDOUT)
--
http://mail.python.or
AndyL wrote:
> What would by a python equivalent of following shell program:
>
> #!/bin/sh
>
> prog1 > file1 &
> prog2 > file2 &
If you're just going for quick-and-dirty, Rob's suggestion of os.system
is probably a reasonable way to go. If you want better error reporting,
I sugges
AndyL wrote:
> Hi,
>
> What would by a python equivalent of following shell program:
>
> #!/bin/sh
>
> prog1 > file1 &
> prog2 > file2 &
>
>
> As you see, I need to spawn a few processes and redirect stdout to some
> files.
For example :
--cut here--