Tkinter callback problem

Ian Terrell kife00 at
Fri Mar 14 02:36:52 CET 2003

> You could try using this definition of getint():
>     def getint(x):
>         if x == "??": return None
>         return int(x)

If I'm going to be editing Python code to fix the problem, I think a
more robust solution is to wrap the calls in try/except

try:  getint(h)
except:  pass

That shouldn't take out any loss of functionality, and I'm sure
Tkinter will adapt in a similar way to handle Tk 8.4.2 soon enough. =)


> that depends on the tk people being nice and never changing the "??"
> string.  But if they'd make this incompatible change during a minor
> release (hm, some python advocate should follow tcl/tk development and
> raise hell when this happens) I wouldn't bet on it.
> Jeff

More information about the Python-list mailing list