Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python get output of command to variable

import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #output #command #variable
ADD COMMENT
Topic
Name
5+9 =