Python 用到了一个将一个数字转化为 对应ASCII 的地方。。。 结果习惯性的用了 ‘a’+1 之类的 或者int('a') , 直接报错==
后来查了查才知道--- 规则== 用的是 ord('a') 和chr(59) 之类: 记录一下吧 挺常用的
-
Python 2.7 .8 (default, Jun 30 2014, 16: 08: 48) [MSC v .1500 64 bit (AMD64)] on win
-
32
-
Type "help", "copyright", "credits" or "license" for more information.
-
'b') # convert char to intord(
-
98
-
100) # convert int to charchr(
-
'd'
-
100) # return a unicode byteunichr(
-
u'd'