How to print non-printable chars??

Julio Cesar Rodriguez Cruz juliocesarrodriguezcruz at gmail.com
Sat Aug 13 00:59:42 EDT 2011


Hi all,
If I open an .exe file in any text editor I get lot of odd chars,
what I want is to know how to output those chars if I have the hexadecimal
code. I found out how to do the reverse process with the quopri module,

i.e.:
>>> import quopri
>>> quopri.encodestring('ñè')
'=F1=E8=18'
>>> quopri.decodestring('=F1=E8=18')
'\xf1\xe8\x18'

but how to do the reverse? ...gived '\xf1\xe8\x18', print 'ñè'

any tips?
thanks
Julio Cesar



More information about the Python-list mailing list