【文件属性】:
文件名称:python-tee:Python库将stderr stdout发送到文件
文件大小:6KB
文件格式:ZIP
更新时间:2021-04-29 15:20:15
Python
python-tee
Python库将stderr / stdout发送到文件
安装
pip install tee
快速开始
tee_test.py
import sys
from tee import StdoutTee , StderrTee
with StdoutTee ( "mystdout.txt" ), StderrTee ( "mystderr.txt" ):
sys . stdout . write ( "[stdout] hello \n " )
sys . stderr . write ( "[stderr] hello \n " )
sys . stdout . write ( "[stdout] world \n " )
sys . stderr . write ( "[stderr] world \n " )
sys . st
【文件预览】:
python-tee-master
----setup.py(1KB)
----.gitignore(1KB)
----tee()
--------tee.py(3KB)
--------__init__.py(82B)
----.travis.yml(2KB)
----LICENSE(1KB)
----README.md(2KB)