TypeError

Fredrik Lundh effbot at telia.com
Thu Oct 26 14:30:21 EDT 2000


Steve wrote:
> Look in the Tkinter documentation at the properties of buttons, and
> you'll probably find what you need is something like
>
> sppedgear.text = str(int(first.text) - int(second.text))
>
> Hope this helps.

not that he's ever gonna tell us (why make it *easy* for
people to help you, when you can waste everybody's time
by playing stupid guessing games?), but it doesn't look like
he's using Tkinter:

>>> w = Tkinter.Button()
>>> type(w)
<type 'instance'>
>>> w
<Tkinter.Button instance at 95b938>
>>> print w
.9812280

(Tkinter's __str__ method returns the internal widget name,
which always starts with a dot)

btw, in Tkinter, you can get the button label as first["text"].
Data entry widgets usually provide a "get" method.

</F>





More information about the Python-list mailing list