avnit wrote: > If you just want to convert a string to an integer, it would be: > > >>> int(n)
That's what the OP tried and it didn't work. BECAUSE you have to tell the int function what base the string is in (even though it has "0x" at the start). >>> int(n,16) 66 > > in your case it would be: > > >>> m=66 > >>> n=int(hex(m)) Wrong again, you still have to tell it what base. >>> h=int(hex(m),16) >>> h 66 -- http://mail.python.org/mailman/listinfo/python-list