python print打印输出中文显示乱码

在开头加上以下代码

网上很多说的这个,我这边使用都是没有效果的


# -*- coding: utf-8 -*-
或者
# encoding: utf-8

这个有效果



#设置
import io
import sys
sys.stdout=io.TextIOWrapper(sys.stdout.buffer,encoding='utf-8')

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注




Enter Captcha Here :