n00b formatting

Chris Rebert clp2 at rebertia.com
Thu Feb 24 12:23:18 EST 2011

On Thu, Feb 24, 2011 at 8:41 AM, Verde Denim <tdldev at gmail.com> wrote:
> hi, all
> i can't believe i don't see this, but
> python from the command line:
>>>> x = '0D'
>>>> y = '0x' + x
>>>> print "%d" % int(y,0)
> 13
> content of testme.py:

Is this the *entire* contents of the file? I suspect not, and that
somewhere in it you assign to `int` as a variable, which should not be
done since it's the name of the built-in type.

> x = '0D'
> y = '0x' + x
> print "%d" % int(y,0)
> TypeError: 'int' object is not callable
> what am i not seeing here??

Please include the full exception Traceback.
Also, add:

print type(int), int

just before the existing `print`.


More information about the Python-list mailing list