Redirect os.system output

Daniel Schüle uval at rz.uni-karlsruhe.de
Fri Oct 21 20:37:34 EDT 2005


maybe you should look at subprocess module

I have one expamle, this is Linux though

 >>> import subprocess as sp
 >>> p1 = sp.Popen(["ls", "-l"], stdout = sp.PIPE)
 >>> p2 = sp.Popen(["wc", "-c"], stdin = p1.stdout, stdout = sp.PIPE)
 >>> print p2.stdout.read()
     226

hth, Daniel




More information about the Python-list mailing list