incrementing string/hex value from file and write back
rami.chowdhury at gmail.com
Thu Aug 20 23:44:57 CEST 2009
Of course - my apologies, I was being an idiot.
On Thu, 20 Aug 2009 14:38:08 -0700, Simon Forman <sajmikins at gmail.com>
> On Aug 20, 5:18 pm, "Rami Chowdhury" <rami.chowdh... at 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 : '0C'.encode('hex')
> Out: '3043'
"Never attribute to malice that which can be attributed to stupidity" --
408-597-7068 (US) / 07875-841-046 (UK) / 0189-245544 (BD)
More information about the Python-list