将python的输出写入log

import sys

sys.stdout = open('2.log', 'a',encoding='utf-8')#输出到日志文件中
发布了218 篇原创文章 · 获赞 110 · 访问量 22万+

猜你喜欢

转载自blog.csdn.net/zhuiyunzhugang/article/details/104745461