popen parameters can be used in call
args, bufsize=0, executable=None, stdin=None, stdout=None, stderr=None, preexec_fn=None, close_fds=False, shell=False, cwd=None, env=None, universal_newlines=False, startupinfo=None, creationflags=0
So...
subprocess.call(["/home/myuser/run.sh", "/tmp/ad_xml", "/tmp/video_xml"], stdout=myoutput)
Then you can do what you want with myoutput (which should be a btw file).
Alternatively, you can do something closer to an output channel like this.
dmesg | grep hda
:
p1 = Popen(["dmesg"], stdout=PIPE) p2 = Popen(["grep", "hda"], stdin=p1.stdout, stdout=PIPE) output = p2.communicate()[0]
There is a lot of great useful info on the python manual page .
ocodo Jan 31 '11 at 10:01 2011-01-31 22:01
source share