python中实现字符与其ASCII码间的转换

来源:互联网 发布:saas软件怎么销售 编辑:程序博客网 时间:2024/05/06 07:52

chars  =  'a'# Get the ASCII number of a characternumber = ord(chars)number = 48# Get the character given by an ASCII numberchars = chr(number)


如果是Unicode字符,可以使用ord()和unichr()函数。
0 0
原创粉丝点击