Python2 vs Python3: str
来源:互联网 发布:青岛衣知她有限公司 编辑:程序博客网 时间:2024/06/14 16:44
Python2 vs Python3: str
Python2 中存在2种str
>>> a='123'>>> b=u'123'>>> type(a)<type 'str'>>>> type(b)<type 'unicode'>
Python3中只存在1种str
>>> a='123'>>> b=u'123'>>> type(a)<class 'str'>>>> type(b)<class 'str'>>>> b='\u8bf7'>>> type(b)<class 'str'>
Python3新增了一种类似bytes
>>> b=b'\u8bf7'>>> b.decode('unicode-escape')'请'>>>>>> type(b)<class 'bytes'>
阅读全文
0 0
- Python2 vs Python3: str
- Python2.x vs Python3
- python3 vs. python2
- Python3与Python2的坑之unicode/str
- 关于python2中的unicode和str以及python3中的str和bytes
- Python2.x vs Python3——从 raw_input() 到 input()
- Python2 & Python3
- python2 unicode str
- python2.7:str
- python2 unicode str
- Python3 str数组处理
- python2.7:str.find 用法
- python2.7:str unicode 详解
- Python2中unicode转str
- python3 与 python2区别
- python2.x ~ python3.x
- python2 python3语法区别
- python2/python3 name对照
- APM飞控添加新的飞行模式,并在地面站Mission Planner里显示
- 平面点排序(一)
- 迭代器萃取和反向迭代器
- python命令:truncate,extend,subprocess模块
- React Native入门(十四)之动画(1)Animated详解
- Python2 vs Python3: str
- 浏览器光标闪烁无法输入
- liunx 时间函数与时间格式与字符串之间转化
- MySQL常用SQL语句大全
- spring——(1)ioc容器和Di依赖注入
- NGUI滚动条ScrolBar
- 宾馆房间 hotelroom
- 驾校自动预约
- nsq