RosettaCodeData/Task/Execute-a-system-command/Python/execute-a-system-command-4.py

5 lines
86 B
Python
Raw Permalink Normal View History

2013-04-10 16:57:12 -07:00
import commands
stat, out = commands.getstatusoutput('ls')
if not stat:
print out