Python GUIs: Abandoning TkInter and welcoming wxPython?

Reimer Behrends behrends at cse.msu.edu
Tue Jun 29 01:21:25 EDT 1999


Andrew Cooke (andrew at andrewcooke.free-online.co.uk) wrote:
> Tk isn't the standard GUI for Python - it's the standard GUI.  It's
> been around for aeons and I, for one, would be a tad annoyed if I
> had to learn a new GUI each time I learnt a new language.
> 
> There seem to be two problems with it:
> 
> 1. Speed.

First of all, I do not even agree that the speed of Tkinter (or other
Tk-based libraries) is a problem at all. In my experience, the speed and
responsiveness has always been more than adequate (as opposed to, say,
AWT and Swing). Unless you are going to program highly interactive
graphical games, speed should be more than sufficient.

> For most applications, is this an issue?  Python is, above
> all, a scripting language.  Speed is not important.  What you can do -
> and do fairly simply with Tk, once you know it, is build a GUI front-
> end to whatever programs you are tying together.  The text widget, for
> example, is amazingly flexible with very little code.

I have to disagree at least partly--in a GUI, speed (and in particular,
responsiveness) is an issue. On the other hand, I _did_ write at least
one program where high responsiveness was an issue (read: interactive
gaming), and Tk never gave me any headaches, even on slower machines.

> 2. Widgets.  Tk certainly doesn't have a modern set of widgets.  There
> are extensions, however.  And with Idle, it looks as though the range
> included in standard Python is increasing (does anyone complain Idle
> is slow?!)

However, Tk[inter] is easily extensible (and you don't even have to
recompile anything for that), with fairly powerful basic widgets. For
instance, when I needed gauge widget, I put it together in just a few
minutes.

Also, I can run Tk-based programs on just about any system I have access
to without changes (as opposed to, for instance, Gtk-based code, which
even with the advent of version 1.2 remained pretty much a moving
target).

[...]

> For others, I suspect the lack of good docs for Tk is a more serious
> problem.  There is a pretty steep learning curve involved if you're
> meeting Tk for the first time (and if you do know it, finding the
> right way to express it in Python can still mean reading the Tkinter
> code).

I always thought that Fredrik Lundh's introduction to Tkinter was
excellent (and easily accessible from the Tkinter page on
www.python.org, too). What problems do you see with it?

[...]

				Reimer Behrends




More information about the Python-list mailing list