Python style questions
Don O'Donnell
donod at home.com
Sun Mar 18 23:42:04 EST 2001
Cary O'Brien wrote:
>
> In article <98tclh$ap6$2 at lahti.tasking.nl>,
> Dick Streefland <dick_streefland at tasking.com> wrote:
> >cobrien at Radix.Net (Cary O'Brien) wrote:
> >| 4. I need to change things like "88aa99bb" (hex string) into integers. Should I
...
> >c. use string.atoi(s, 16), or for Python >= 2.0, the builtin int(s, 16).
...
> >
> >>> import string
> >>> string.atoi('abcd',16)
> 43981
> >>>
>
> Ok, that works. Missing in my "Python essential reference" though.
>
hmmm, that's funny it's in my PER, under "string" in the Library
section, page 116:
atoi(s, [, base])
Converts string s to an integer base is an optional base.
/Don
More information about the Python-list
mailing list