Python—UnicodeEncodeError: 'ascii' codec can't encode/decode characters

来源:互联网 发布:中老年妈妈装淘宝网 编辑:程序博客网 时间:2024/06/01 17:14

之前将Python代码放到服务器运行时,出现过这种错误,添加以下代码解决

import ioimport syssys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')
阅读全文
0 0