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
Assuming that pwd is just an example, this is how you can do it:
pwd
import subprocess p = subprocess.Popen("pwd", stdout=subprocess.PIPE) result = p.communicate()[0] print result
See the subprocess documentation for another example and more information.