int() should be extended?

sismex01 at hebmex.com sismex01 at hebmex.com
Mon Oct 21 11:45:52 EDT 2002


> From: Xiao-Qin Xia [mailto:xx758 at cam.ac.uk]
>
> since use exec is not so good a habit, is there any other way 
> to convert 
> "0x41" to 65 (0x41)?, or int() should be extened to do this job?
> 
> Thanks, 
> Xiao-Qin Xia
>

>>> s = "0x41"
>>> int(s[2:])
65

Good luck!

-gustavo




More information about the Python-list mailing list