Python - string to hexbytes conversion - HELP!

Carsten Gaebler clpy at snakefarm.org
Thu Dec 6 11:37:07 EST 2001


me wrote:

> if I do a read and get a='1234567'
> I need  an equivalent string to be
> b=Chr(0x01)+chr(0x23)+chr(x045)+chr(0x67)

>>> import binascii
>>> binascii.unhexlify("01234567")
'\x01#Eg'
>>> 

cg.
-- 
For dealing with Matrix you need something more powerful than Python.
Otherwise ... Matrix has you!         -- scenes from comp.lang.python



More information about the Python-list mailing list