Results 1 to 1 of 1
Thread: Manipulating buffer contents
Enjoy an ad free experience by logging in. Not a member yet? Register.
- Join Date
- Mar 2009
Manipulating buffer contents
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)
c = chr(a)
d = chr(a)
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