Hi,

I need help forcing the contents of a buffer (decimals) to hex. For example

a = (36, 31, 35)

I want to be able to strip the last nibbles of those three numbers (6,1,5). I need to have python force these to be hex numbers so that I can then do the following:

b = chr(a[0])
c = chr(a[1])
d = chr(a[2])

a = (b,c,d)

result = "".join(a)

which would then yield my '615' result.

Unfortunately, this wont work because in my original instance of a, Python sees those numbers as decimals and not hex. Can anyone point me towards the light ?

Im using Python Version 2.5.4 & and IDLE version 1.2.4

regards,
tangent