强调的一点是,不支持参数,不支持管道
os.open方式:
import os
output = os.popen('df')
print output.read() #如果命令自身无报错,则返回正确的值...another_argument_or_path")
from subprocess import call
call(['ls','-l','/boot','/sys']) #
call('ls -a /',shell...=True)
subprocess.Popen(command,shell=True)
class subprocess.Popen(args, bufsize=-1, executable=None,... stdin=None, stdout=None, stderr=None,
preexec_fn=None, close_fds=True, shell=False, cwd=None, env