November 14, 2021

Python - wxPython

The "wx" widgets are a popular alternative to tkinter for Python GUI development. What are the pros and cons you ask? If you are familiar with Tk from Tcl or Perl you will find tkinter quite familiar. Than could be a big plus if you have that background (as I do). The wxPython package is a binding on top of "wxWidgets" which is a C++ library. This gives it a strong object oriented flavor. You can either view this as a good thing, or a bigger hurdle to learning them. Both are cross platform, meaning you can write code that is portable from linux to Windows or Mac systems. One person says that wxPython requires less "voodoo code" than Tkinter to get running, which makes me chuckle. People say that Tkinter is much more stable, but they also say that Tkinter is "old, worn out, and falling out of favor".

There is also PyQt, but I am having nothing to do with that.

One annoyance is that wxPython has changed over time and if you search for examples and tutorials online, you will have to sort out API changes. However, the basic concepts and the bulk of things remain the same.

Phoenix

I am experimenting with wxPython on Fedora 34 linux. Some investigation reveals I am using "python3-wxpython4.x86_64 4.0.7-16.fc34" This turns out to be wxPython "Phoenix".

Apparently there are both "Classic" and "Phoenix" flavors of wxPython. Classic has 3.x version numbers and Phoenix has 4.x version numbers. Phoenix aims to be compatible with Python 3. Classic may well be static and abandoned.


Feedback? Questions? Drop me a line!

Tom's Computer Info / [email protected]