Strings

keirr keir.robinson at gmail.com
Thu Apr 21 09:49:17 EDT 2005


I'd use the int and chr casts.  e.g.,

new_string = ""
a = '012'
new_string += chr(int(a))

Just in case the 012 is an octal code I'll mention that to cast to int
in general you can pass the base, as in int('034',8) or int('AF',16)

Cheers,

 Keir.




More information about the Python-list mailing list