os.spawn

Alex Martelli aleax at aleax.it
Tue Apr 29 09:46:51 EDT 2003


Jeroen Wolff wrote:

> Hi,
> 
> I want to run some shell commands from within python.
> Wat i normal do at the shell prompt is:
> 'flow-cat <dirname> | flow-stat <param> > outputfile.txt'
> 
> I like to do this from within python and wait for it to finish and the
> process the outputfile.txt
> Is this possible? The problem is with '|' and '>" piping....

Why is this a problem?  Doesn't everything run as you wish
when you do:

import os
os.system('flow-cat dirname | flow-stat param > outputfile.txt')

???


Alex





More information about the Python-list mailing list