Is python2.5's Tix wrapper broken?

Ron Provost ronpro at cox.net
Tue Feb 13 20:10:54 EST 2007


I have  a piece of software I wrote some time ago using Python and the Tix 
wrapper.  I just upgraded to Python 2.5 and to my surprise my software no 
longer functions.  There's a problem with the Tix wrapper.  Under a clean 
install of Python the following should display an empty root window on the 
screen and happily.

>>> import Tix
>>> root = Tix.Tk()

Under Python2.5, the empty root window is displayed but I also get a 
Traceback:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python25\lib\lib-tk\Tix.py", line 210, in __init__
    self.tk.eval('package require Tix')
_tkinter.TclError: can't find package Tix

Of course I can fix this with a cheap try block, but wonder if there's a 
better way.

   try:
      root = Tix.Tk()
   except:
      print "Tk exception caught"

Is Tix now broken or is there a new "proper" way to get a Tk root window?

Thanks,
Ron 





More information about the Python-list mailing list