wxPython Overview

7 PM June 15, 2003

Over the last couple of weeks, I put together a prototype Python application. It was a proof-of-technology prototype, designed to show that all the libraries and products proposed work together.

After a night’s Googling and reading about various windowing libraries for Python, I settled on wxPython. wxPython’s maturity, cross-platform functionality, flexibility and liberal licensing made it the stand-out choice.

wxPython is a thin layer over wxWindows, a cross-platform C++ GUI library which has been around for more than a decade. This mature base gives wxPython several advantages:

  • it is stable and full featured,
  • plenty of standard widgets, including grid, tree and notebook,
  • works on both Windows and Linux1.

In terms of documentation, wxPython ships with a reference manual and comprehensive sample code. There is also wxPyWiki on-line.

Interestingly, the reference manual is the standard wxWindows manual, and because wxPython is such a thin layer over wxWindows, the manual is surprisingly understandable2. It also highlights the efforts that the wxWindows programmers have gone to to make their API simple and usable.

Another thing that attracted me to wxPython is how well it cooperates with other libraries. The sample programs show you how to embed both PyGame and ActiveX controls. ActiveX is done via win32all.

Threre are a few downsides. First up, wxPython does not have a consistent, high-level architecture for interacting with a business model. A Smalltalk or Java style event framework would have been nice.

Second, the GUI callback mechanism is based around assigning integer IDs to controls. Even though wxPython provides some help generating the IDs, it is still a little clunky and I can see that it would become an issue in a really large application.

There are several GUI builders that work with wxPython: BOA Constructor, wxDesigner and wxGlade are the most obvious. Python Card is a GUI library built on top of wxPython.

Overall, wxPython is a pleasure to work with and one of the more complete and mature GUI libraries I’ve used, in any language.

1 wxPython for Mac has just been released too. The download page says, “It’s still a little rough in places, but most things work.”

2 Though if you don’t already know C++, you might find this guide helpful.

By alang | # | Comments (0)
(Posted to Software Development)

Comments

Add Comment




(Not displayed)






(Leave blank line between paragraphs. URLs converted to links. HTML stripped. Indented source code will be formatted with <pre> tags.)




© 2003-2006 Alan Green