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
import subprocess output = str(subprocess.Popen("ntpq -p",shell = True,stdout = subprocess.PIPE, stderr = subprocess.STDOUT).communicate()[0])
This is one line solution