标签:
import subprocess proc = subprocess.Popen([‘python‘, ‘test.py‘], stdout=subprocess.PIPE) while 1: print proc.poll()
#while 1: # print "hello" print "hello"
测试代码如上,poll函数返回码:
0 正常结束
1 sleep
-15 kill
None 在运行
poll的返回: A None value indicates that the process hasn’t terminated yet.A negative value -N indicates that the child was terminated by signal N (Unix only). --来自baidu知道
标签:
原文地址:http://www.cnblogs.com/nerrissa/p/5375206.html