[Tutor] Tkinter-wxPython

Magnus Lycka magnus@thinkware.se
Wed, 07 Aug 2002 04:36:51 +0200


At 14:53 2002-08-06 +0200, Andrea Valle wrote:
>Dear List,
>what are the main differences between Tkinter and wxPython?

Tkinter is a standard Python module. wxPython is not, so
you rely on a third party library.

wxPython is more full featured, with grid controls etc. With
Tkinter, you are likely to need extensions, such as Python
Mega Widgets (pmw), if you do anything substancial. So you
will probably come to rely on third party libraries anyway.

If you just need a simple GUI, Tkinter has a clear advantage
of making it easier to deploy your application. No need to
install anything extra, just std Python and your code.

Tkinter is based on a GUI toolkit called Tk, which is made
for an interpreted language called Tcl. It's not very fast.
wxPython is based on a C++ GUI toolkit called wxWindows. It's
typically somewhat faster. I imagine the difference is more
noticable for the advanced controls, since these will be
written in Python for Tkinter (pmw etc) but in C++ for wxPython.

Also, there are books with Tkinter coverage, first of all,
"Python and Tkinter Programming". There are also a number of
books on Tcl/Tk that might be of use for the Tkinter programmer.

There is little wxPython documentation. It comes with the
wxWindows C++ based documentation with a few notes about
differences in the Python version. Also, the wxWindows docs
aren't kept entirely updated, and wxWindows / wxPython is
growing and changing quite a bit. There are good demos that
give examples of most features though.

There are plenty of users for both toolkits. I don't know if
there is any such thing as a "Tkinter community" since Tkinter
is a standard module. There are obviously both books, internet
resources and people on the net that might be of help.

For wxPython, there is a site www.wxpython.org, and a mailing
list where the lead developer Robin Dunn and many other wxPython
programmers provide a lot of help to programmers.

wxPython and wxWindows is being much more actively developed
than Tcl/Tk and Tkinter. Whether that is good of bad is for
you to judge. Tcl/Tk is fairly mature (if, as I wrote, somewhat
lacking of advanced controls).

wxPython is concidered important by the wxWindows developers,
while I don't think the Tcl/Tk developers (are there still any?)
care a bit about making Python users happy.

I think Tkinter works on a few more platforms than wxPython. But
wxPython works well on Windows, Linux and a number of Unix
dialects at least. I'm uncertain about the current status of
the Mac port.

Python Programming on Win32 by Mark Hammond & Andy Robinson
has a chapter on GUI programming which covers both. It's online:
http://www.oreilly.com/catalog/pythonwin32/chapter/ch20.html
There you can see code examples with both.


--=20
Magnus Lyck=E5, Thinkware AB
=C4lvans v=E4g 99, SE-907 50 UME=C5
tel: 070-582 80 65, fax: 070-612 80 65
http://www.thinkware.se/  mailto:magnus@thinkware.se