TypeError

Kalle Svensson kalle at gnupung.net
Thu Oct 26 18:57:19 EDT 2000


On Thu, 26 Oct 2000, joonas wrote:

> Btw i am not using Tkinter.
> I am using Blender, that is a 3d modelling software.
> 
> I tried 
> "speedgear.text = str(int(first.text) - 10)"
> and it gave me error,"name error text".
> 
> Then i removed ".text" from objects and it gave me "object cant be
> converted to int".

Ok, this is the situation. You have a button, which when it is stringified
(through str(button), print button, button.__str__() or whatever)
yields a string of digits.
int(a_string) makes an integer from a string of digits.

Thus, perhaps you could use
int(str(first)) - int(str(second))
to get the difference between the integers represented by the buttons?

Yuck.

HTH,
  Kalle
-- 
Email: kalle at gnupung.net     | You can tune a filesystem, but you
Web: http://www.gnupung.net/ | can't tune a fish. -- man tunefs(8)
Not signed due to logistical difficulties (I'm not at home).
If you doubt the authenticity of this message, please tell me.





More information about the Python-list mailing list