Convert hex to string

jepler at unpythonic.net jepler at unpythonic.net
Mon Oct 3 22:30:52 CEST 2005


it *is* a string.

because most of the characters are not printable, they're presented using hex
notation when you repr() the string.  That's what entering an expression in the
interactive interpreter does (except that it never prints 'None').

If you really want to write whatever those bytes are, then do something like
>>> print x
or 
>>> sys.stdout.write(x)

Jeff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/python-list/attachments/20051003/30842c8a/attachment.pgp>


More information about the Python-list mailing list