【发布时间】:2017-02-07 21:18:21
【问题描述】:
我在 python 中执行了这段代码:(test.py)
from subprocess import Popen
p = Popen("file.bat").wait()
这是file.bat:
@echo off
start c:\python27\python.exe C:\Test\p1.py %*
start c:\python27\python.exe C:\Test\p2.py %*
pause
这里是 p1.py:
This line is error
print "Hello word"
p2.py 没意思
我想通过运行 test.py 来了解 p1.py 中的异常(不仅仅是编译错误)? 我该怎么做?
谢谢!
【问题讨论】:
标签: python subprocess popen