Pros and cons of tkinter and wxWidgets?

I am reading this tutorial, which helps me learn both tkinter and wxWidgets in parallel, but I want to work deeply, so I would like to know which GUI tool is better to study in depth and why?

+6
tkinter
source share
2 answers

It is impossible to say that "better." Or it can be used for most common user interface tasks.

If I could somehow generalize the sentence, I would have the desire to say that Tkinter is better designed and a little easier to use, but wxPython is more functional and looks a little nicer.

tkinter pros : part of python, nothing more to download. Very simple syntax. The text widget is remarkably powerful and very easy to use. The canvas widget is also very simple and powerful. No other toolkit provides the same lightness and power as these two widgets in my experience. Uses native widgets on Mac and Windows. Tk is a solid with several cross-platform features. I think the Tkinter binding mechanism is far superior to wxPython; It is more flexible and consistent. I think that Tkinter's three geometry managers - package, location, and mesh - are much more powerful and easy to use than wxPython simulators.

tkinter cons: Uses widget-like motifs on * nix boxes that many find out of the game (although some cautious settings may make the GUI look quite acceptable). It is sometimes difficult to debug that Tkinter widgets are not python objects by their core; tkinter provides a wrapper around real tk widgets, which sometimes means that you get strange error messages. There is very little print support (you can create postscript documents from the canvas, but there is no built-in support in the text widget for printing). Some people claim that Tk is ugly. Tkinter is not "pythonic" like wxPython.

wxpython pros : it has many more widgets, although this often means that there are three types of widgets for laptops, not just one kitchen sink widget. WxPython widgets are first-class python objects that are really nice. wxPython usually looks better on * nix machines. wxPython seems more popular; some people care about this, others not. wxPython has much better print support than Tkinter.

wxPython cons : wxPython requires a separate download, which can be a pain to manage when deploying the application. In my opinion, the documentation is very weak; it is very difficult to find specific information. The book "wPython in Action" provides a good introduction, but it should not be referenced as a reference. wxPython is a slightly erroneous IMO, and there are certain cross-platform issues. I saw wxPython errors and printed statements more often than Tkinter.

+14
source share

If you are a beginner and want to choose one, I highly recommend tkinter for its simplicity and effectiveness. wxPython can wait until you have a very good understanding of python, especially classes and the GUI in general.

+1
source share

All Articles