python的chr()、unichr()和ord()
来源:互联网 发布:郑玲玲的淘宝店叫什么 编辑:程序博客网 时间:2024/06/11 02:52
chr()、unichr()和ord()
chr()函数用一个范围在range(256)内的(就是0~255)整数作参数,返回一个对应的字符。unichr()跟它一样,只不过返回的是Unicode字符,这个从Python 2.0才加入的unichr()的参数范围依赖于你的Python是如何被编译的。如果是配置为USC2的Unicode,那么它的允许范围就是range(65536)或0x0000-0xFFFF;如果配置为UCS4,那么这个值应该是range(1114112)或0x000000-0x110000。如果提供的参数不在允许的范围内,则会报一个ValueError的异常。
ord()函数是chr()函数(对于8位的ASCII字符串)或unichr()函数(对于Unicode对象)的配对函数,它以一个字符(长度为1的字符串)作为参数,返回对应的ASCII数值,或者Unicode数值,如果所给的Unicode字符超出了你的Python定义范围,则会引发一个TypeError的异常。
- python的chr()、unichr()和ord()
- python chr()、unichr()和ord()
- Python的chr()、unichr()、ord()
- Python chr() ord() unichr()
- chr()、unichr()和ord()
- chr()、unichr()和ord()
- chr()、unichr()和ord()
- 飘逸的python - ord和chr以及unichr
- python chr()、unichr()和ord()使用
- python ord() chr() unichr() 函数
- Python内置函数chr() unichr() ord()
- python chr()和ord()
- python chr()和ord()
- python chr()和ord()
- python chr()和ord()
- python chr()和ord()
- python 中常见字符函数 chr unichr ord函数介绍
- python的chr()和ord()函数
- Maven创建的Web项目无法使用EL表达式
- 可靠性相关
- SQL SERVER三种恢复模型
- 高性能网络编程2----TCP消息的发送
- oracle 闪回
- python的chr()、unichr()和ord()
- Mahout贝叶斯算法源码分析(1)
- 高性能网络编程3----TCP消息的接收
- MySQL源码分析及核心内幕之2 -- 源码调试之gdb
- Ubuntu装配宋体
- 【工具】各种网络工具 相当实用 【不定期更新】
- VC2005打开VC6工程可能遇到的错误参考方案
- RAC 的并发控制
- IJCAI13 Web and Knowledge-based Information Systems概述(1)