Converting a hex string to an integer
Adrian Eyre
a.eyre at optichrome.com
Tue Apr 4 09:40:33 EDT 2000
More information about the Python-list mailing list
Tue Apr 4 09:40:33 EDT 2000
- Previous message (by thread): What happened to Python.announce?
- Next message (by thread): Determining Classname of an object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> >>> import string
> >>> string.atoi("0xab", 0)
> 171
>
> or in 1.6:
>
> >>> int("0xab", 0)
> 171
or (probably available since v1.0):
>>> eval("0xab")
171
#include <UsualEvalWarnings.h>
-----------------------------------------------------------------
Adrian Eyre <a.eyre at optichrome.com> - http://www.optichrome.com
- Previous message (by thread): What happened to Python.announce?
- Next message (by thread): Determining Classname of an object
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list