报错:UnicodeEncodeError: ‘ascii‘ codec can‘t encode characters in position 0-1: ordinal not in range(1

Python3报错处理:UnicodeEncodeError: ‘ascii’ codec can’t encode characters in position 0-1: ordinal not in range(128)

解决问题参考地址:https://www.cnblogs.com/lsdb/p/12470739.html

在python代码前面中加入如下代码块:

import sys
import codecs

sys.stdout = codecs.getwriter("utf-8")(sys.stdout.detach())

你可能感兴趣的:(python报错,python)