sys module has the stdout and stderr attributes that point to files used for standard output and standard error output. : Sys : Buildin Module PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Module » Sys »

 

sys module has the stdout and stderr attributes that point to files used for standard output and standard error output.


import sys

sOUT = sys.stdout
sERR = sys.stderr

sys.stdout = open("ouput.txt""w")
sys.stderr = sys.stdout
sys.stdout = sOUT
sys.stderr = sERR



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Module
» Sys