Dennis Lee Bieber wrote:
>>>>dt = "D0360000EC"
>>>>print repr("".join([chr(int(dt[2*x:2*x+2],16)) for x in range(len(dt)//2)]))
>
> '\xd06\x00\x00\xec'
By the way, for future reference, this way beats the above hands down:
>>> import binascii
>>> binascii.unhexlify("D0360000EC")
'\xd06\x00\x00\xec'
-Peter
--
http://mail.python.org/mailman/listinfo/python-list
