There is a handy subprocess.check_call function in 2.7, but if you’re using 2.6, you can use this (for some reason, it’s quite hard to find):
command = ‘ls -la’
stdout_handle = os.popen(command)
stdout = stdout_handle.read()
print stdout
There is a handy subprocess.check_call function in 2.7, but if you’re using 2.6, you can use this (for some reason, it’s quite hard to find):
command = ‘ls -la’
stdout_handle = os.popen(command)
stdout = stdout_handle.read()
print stdout