Python obtient la sortie de la commande à la variable
import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)
Breakable Baboon
import subprocess as sp
output = sp.getoutput('whoami --version')
print (output)
os.popen('cat /etc/services').read()
>out = subprocess.Popen(['wc', '-l', 'my_text_file.txt'],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT)