【发布时间】:2020-06-26 12:25:57
【问题描述】:
有没有办法检查我的 python 程序是否将某些内容打印到特定流?
【问题讨论】:
-
你的意思是任何流吗?不仅仅是标准输出?
-
尤其是标准输出和标准错误。
标签: python python-3.x printing stream
有没有办法检查我的 python 程序是否将某些内容打印到特定流?
【问题讨论】:
标签: python python-3.x printing stream
对于python 3.x你可以试试
print('print this stuff')
import sys
sys.stdout.write('print this stuff')
【讨论】: