Python ASCII码与字母的相互转换
# -*- coding:utf-8 -*- str_var = 'a' var = ord(str_var) print 'var type:',type(var) print var print data = 65 var = chr(data) print 'data type:',type(data) print 'var type:',type(var) print var
# -*- coding:utf-8 -*- str_var = 'a' var = ord(str_var) print 'var type:',type(var) print var print data = 65 var = chr(data) print 'data type:',type(data) print 'var type:',type(var) print var