您的位置:首页 > 编程语言 > Python开发

python 输出乱码

2015-11-01 16:18 627 查看
在Python中有两种默认的字符串:str和unicode。在Python中一定要注意区分“Unicode字符串”和“unicode对象”的区别。后面所有的“unicode字符串”指的都是python里的“unicode对象”。

#!/usr/bin/python
#coding=utf-8
s='文博';
print s;

会出现乱码

#!/usr/bin/python
#coding=utf-8
s=u'文博';
print s;

不会出现乱码。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: