WxPython versus Tkinter.

Bryan bryan.oakley at gmail.com
Mon Jan 24 14:00:43 EST 2011


On Jan 24, 8:49 am, Mike Driscoll <kyoso... at gmail.com> wrote:
>
> Bryan, on the other hand, has been aTkinterluminary who has helped
> me in the past when I was learningTkinterand I won't be too
> surprised if he helps me again. I'm sorry he's had so much trouble
> with wx though.

Thanks for the kind words, I appreciate it.

I'm puzzled by the problems I have with wxPython, too. It's taken me
longer to get a grasp on some concepts that I would have guessed. The
first time I got a segfault I was stunned but shrugged it off. A
segfault in a scripting language? Blasphemy! Now I'm not so stunned
anymore, but I still shrug them off. Part of the blame certainly rests
on my shoulder. With only a year and a half or so under my belt with
wxPython there's still lots I have to learn and the documentation only
gets me so far. What's the rule of thumb -- it takes 10 years to
become an expert on a subject?

The underlying architecture of tk is so solid, so well designed (IMHO)
that you (well, I) take a lot of stuff for granted. Then you switch to
something like wxPython where the foundation is maybe a little shaky
in exchange for a much richer library of widgets, and the transition
is bound to be bumpy. It's not generally a matter of "better" or
"worse", just "different".

The key to success is to realize both of the toolkits are just that --
toolkits. They aren't religion, they aren't an assault on family
values or a threat to national security. They are tools to get the job
done. Instead of saying "mine is better than yours" it's better to
learn the strengths and weaknesses of both (or all) and pick the right
one for the job. Attempting to prove that any of these toolkits is
"best" is tilting at windmills.

Personally, I think tkinter is the right choice as a built-in toolkit
but I'll admit to bias. The basics are really simple, and for 90% of
the stuff you're going to code in a scripting language it has all the
features you need. If you specifically need something like the
styledtextctrl or grid of wxPython, or maybe you're concerned with
accessibility or some feature that's not built in to tkinter, by all
means switch to a different toolkit. That's the beauty of these GUI
toolkits -- you can keep the language you love (python, in the case of
this newsgroup) yet pick the GUI toolkit that best helps you solve the
problem at hand.

Instead of fighting over the differences, raise a pint in celebration
of their diversity. :-)



More information about the Python-list mailing list