python获得字符的ascii码,根据ascii码获得字符,pythonascii,python提供了ord
python获得字符的ascii码,根据ascii码获得字符,pythonascii,python提供了ord
python提供了ord()
方法和chr()
可以实现将字符转换为ascii码和将ascii码转为字符的功能
>>> ord('a')97>>> chr(97)'a'>>> chr(ord('a') + 3)'d'>>>
还有一个unichr()
函数可以将数字转换为unicode字符
>>> unichr(97)u'a'>>> unichr(1234)u'\u04d2'
相关内容
- python实现substring截取子字符串,pythonsubstring,python中没有
- python判断字符串是否包含字串的方法,python字串,pytho
- Python实现的Rss Reader,pythonrssreader,如下代码使用python
- python HTTP 客户端库–requests介绍,pythonrequests,>>&g
- python利用property装饰器设置只读属性,pythonproperty,如果
- python字符串内置方法,python字符串内置,在这一篇文章中
- python处理gzip压缩的http数据,pythongzip,其实关于这个内容
- Python使用gzip压缩数据包,pythongzip数据包,将数据使用
- 使用pyinstaller打包python为exe文件,pyinstallerpython,使用p
- python tkinter 窗口居中对齐,pythontkinter,tkinter没有现成的
评论关闭