how to get on with parents作文(How to get stdout and stderr using Python’s subprocess module « SaltyCrane Blog)
导读:from subprocess import Popen, PIPE, STDOUT cmd = ls /etc/fstab /etc/non-existent-file p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=Tru...
from subprocess import Popen, PIPE, STDOUT cmd = ls /etc/fstab /etc/non-existent-file p = Popen(cmd, shell=True, stdin=PIPE, stdout=PIPE, stderr=STDOUT, close_fds=True)output = p.stdout.read() print output
创心域SEO版权声明:以上内容作者已申请原创保护,未经允许不得转载,侵权必究!授权事宜、对本内容有异议或投诉,敬请联系网站管理员,我们将尽快回复您,谢谢合作!