首页 > 编程语言 > 详细

python 获取subprocess进程执行后返回值

时间:2019-04-20 10:19:00      阅读:625      评论:0      收藏:0      [点我收藏+]

 

test.py

#coding=utf-8
import subprocess
compilePopen = subprocess.Popen(gcc haha,shell=True,stderr=subprocess.PIPE)
compilePopen.wait()
print(the status code is:,compilePopen.returncode)
with open(log,w) as object:
    object.write(compilePopen.stderr.read())

输出:

(the status code is:, 1)

 

参考:

https://blog.csdn.net/qq_31331027/article/details/80518348

python 获取subprocess进程执行后返回值

原文:https://www.cnblogs.com/sea-stream/p/10739724.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!