pycharm python输出中文出现unicode乱码\x*

论坛 期权论坛 编程之家     
选择匿名的用户   2021-6-2 20:21   2162   0

方法一

# -*- coding: utf-8 -*-
s_list = ['你好', '中国']
print(str(s_list).decode('string_escape'))

方法二

安装 uniout package

终端输入:

sudo pip install uniout

运行python代码

# -*- coding: utf-8 -*-
import uniout
s_list = ['你好', '中国']
print(s_list)

转载于:https://www.cnblogs.com/sunruina2/p/7127415.html

分享到 :
0 人收藏
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

积分:3875789
帖子:775174
精华:0
期权论坛 期权论坛
发布
内容

下载期权论坛手机APP