之前,我有一个python脚本test.py:Python脚本打印使用os.system的输出打印
print "first"
import os
os.system("echo second")
在Linux命令行我执行
python test.py
返回:
first
second
然后执行
python test.py > test.out; cat test.out
返回
second
first
有关重定向输出是什么让打印语句之前使用os.system调用打印?