python3输出unicode
来源:互联网 发布:java软件eclipse中文版 编辑:程序博客网 时间:2024/06/14 16:44
采用ord函数即可
In Python 2.x
- D:\Python27>python
- >>> chr(65)
- 'A'
- >>> ord('A')
- 65
- >>> unichr(20013)
- u'\u4e2d'
- >>> ord(u'\u4e2d')
- 20013
- >>> ord('中')
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- TypeError: ord() expected a character, but string of length 2 found
- >>> chr(20013)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- ValueError: chr() arg not in range(256)
In Python 3.x
- D:\CODE\PYTHON\OPEN_JUDGE>python
- Python 3.2.5 (default, May 15 2013, 23:06:03) [MSC v.1500 32 bit (Intel)] on win32
- Type "help", "copyright", "credits" or "license" for more information.
- >>> chr(65)
- 'A'
- >>> ord('A')
- 65
- >>> chr(20013)
- '中'
- >>> ord('中')
- 20013
- >>> ord('\u4e2d')
- 20013
0 0
- python3输出unicode
- python3 输出和输出
- python3 汉字转十六进制unicode
- python3 格式化输出
- Python3 输入和输出
- python3输出不换行
- Python3 输入和输出
- python3实现逐字输出
- Python3 输入和输出
- Python3 输入和输出
- Python3 输入和输出
- python3格式化输出
- UNICODE字符输出???
- unicode 字符的输出
- 控制台输出CString, Unicode
- Unicode文件输出
- python3 python3:(unicode error) 'utf-8' codec can't decode
- python3 Unicode 编码转换中文显示
- Java调用Oracle存储过程
- 看MapleSim符号如何一步解决并联机构逆运动学问题
- Apache ab 的简单实用
- Android Context 上下文 你必须知道的一切
- ios swift sha1 md5 加密
- python3输出unicode
- 在systemd下如何编写我们的守护进程,利用systemd管理我们的守护进程
- 本文来介绍UITextField控件的使用!
- Python中list的实现
- linux arm和x86 inline hook技术
- 开源机器学习新工具RWeka(R Meets Weka )
- Redis Sentinel:集群Failover解决方案
- 使用spring @Scheduled注解执行定时任务、
- Fragment软键盘的显示和隐藏