RosettaCodeData/Task/Execute-a-system-command/Python/execute-a-system-command-3.py
2023-07-01 13:44:08 -04:00

3 lines
112 B
Python

from subprocess import PIPE, Popen, STDOUT
p = Popen('ls', stdout=PIPE, stderr=STDOUT)
print p.communicate()[0]