print os.system output code example
Example: python get output of command to variable
import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)
import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)