hex string to hex value

tim tim.vets at skynet.be
Tue Nov 22 18:34:07 EST 2005


but then i get :

 >>> m
66
 >>> n=int(hex(m))
Traceback (most recent call last):
  File "<interactive input>", line 1, in ?
ValueError: invalid literal for int(): 0x42
 >>>

what am I missing here ?
thank you
Tim

avnit wrote:

>If you just want to convert a string to an integer, it would be:
>
>  
>
>>>>int(n)
>>>>        
>>>>
>
>in your case it would be:
>
>  
>
>>>>m=66
>>>>n=int(hex(m))
>>>>        
>>>>
>
>  
>





More information about the Python-list mailing list