Re: python equivalent of the following program

2006-05-11 Thread AndyL
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

Re: python equivalent of the following program

2006-05-11 Thread Edward Elliott
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

Re: python equivalent of the following program

2006-05-11 Thread AndyL
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

Re: python equivalent of the following program

2006-05-11 Thread Edward Elliott
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

Re: python equivalent of the following program

2006-05-11 Thread Steven Bethard
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

Re: python equivalent of the following program

2006-05-11 Thread blue99
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--