sys.stdout

来源:互联网 发布:最小公约数算法 编辑:程序博客网 时间:2024/04/29 19:34
##将标准输出绑定到f上,会显示在屏幕上的内容也会被写入test.txtimport sysimport stringf=open('test.txt','w')sys.stdout=f  help(string)f.close()

0 0
原创粉丝点击