import sys
#start
output = sys.stdout
outputfile = open(filename,'w')
sys.stdout = outputfile
#end
outputfile.close()
sys.stdout = output
python 重定向输出到文件
最新推荐文章于 2023-07-28 14:20:39 发布
import sys
#start
output = sys.stdout
outputfile = open(filename,'w')
sys.stdout = outputfile
#end
outputfile.close()
sys.stdout = output