On Aug 20, 5:18 pm, "Rami Chowdhury" <rami.chowdh...@gmail.com> wrote: > > val = val.encode('hex') > > That's the crucial line -- it's returning a new integer, which you are > re-binding to val. If you then did:
No, it returns another string, which still isn't the decimal representation of the hex string. hex C => decimal 12 In [1]: '0C'.encode('hex') Out[1]: '3043' -- http://mail.python.org/mailman/listinfo/python-list