hex to int

Jason Orendorff jason at jorendorff.com
Thu Feb 14 17:21:49 EST 2002


Antaeus Feldspar wrote:
> Bjorn Pettersen wrote:
> > >>> int('0xff', 16)
> > 255
> 
> In what version of Python do they introduce that?  In the documentation
> I have int() is listed as taking one and exactly one argument.  The code
> you list doesn't work for me.

Waaaaay back in Python 1.6.
  http://www.python.org/doc/1.6/lib/built-in-funcs.html
  http://www.python.org/doc/current/lib/built-in-funcs.html

Unfortunately, a lot of people are stuck with Python 1.5.2,
which will be three years old in April.  (sigh)

## Jason Orendorff    http://www.jorendorff.com/




More information about the Python-list mailing list