Problem
You need to turn a character into its numeric ASCII(ISO) or Unicode code, and vice versa.
Solution
That's what the built-in functions ord and chr are for:
>>>
print
ord(
'
a
'
)
97
>>> print chr( 98 )
b
97
>>> print chr( 98 )
b
The built-in function ord also accepts as its argument a Unicode string of length one. in which case it returns a Unicode code value, up to 65536. To make a Unicode string of length one from a numeric Unicode code value, use the built-in function unichr: