I\'m trying to make a system call in Python and store the output to a string that I can manipulate in the Python program.
#!/usr/bin/python import subprocess
This worked for me for redirecting stdout (stderr can be handled similarly):
from subprocess import Popen, PIPE pipe = Popen(path, stdout=PIPE) text = pipe.communicate()[0]
If it doesn't work for you, please specify exactly the problem you're having.