1、添加系统变量app
在window环境变量中,添加环境变量 PYTHONIOENCODING = UTF-8。编码
PYTHONIOENCODING
UTF-8。
2、在文件中设置输出编码spa
import io import sys sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8')