Python GUIs

I’m a Python nut. When there’s a problem that doesn’t fit squarely into the purview of C/C++ or JavaScript, odds are pretty high that I’ll use Python to solve it, which means that I’m sorely disapointed when Python doesn’t live up to it’s lofty potential. Case in point: GUI programming.

Python has bindings for any number of GUI toolkits these days: PyGTK, PyQT, Win32-extensions, PyObjectiveC. Hell, Python even still ships with Tkinter (the TCL/TK interface). But what really gets me is that none of these are REALLY portable. Oh, sure, GTK finally got ported to Win32 in a high-quality way, and QT has been available on Windows forever, but none of these options are all of the following:

  • self contained
  • covers all of the platforms I care about (Linux, OS X, Windows) natively
  • doesn’t need a pre-compiler
  • very Pythonic

So how do I get to a situation where I can just include some files with the distutils package of my Python code and be sure that I’m “OK” on whatever platform I get installed on? My thinking right now is that something as ambitious, open, and well thought out as SWT is probably a good answer. Doing C/C++ wrappers is something that Python is good at, and even ObjectiveC can be made to “play nice”. SWT also introduces most of the widgets you’d need as well as solving the event wrapping problem. If I ever get a couple of free months, it might be a good thing to re-implement the SWT class hierarchy in Python. I don’t really look forward to doing all the C-Python work, but the SWT guys have already done a lot of it that we could look at.

Time to stop waiting for a workable, portable, native, and fast GUI toolkit for Python. This is one time where Java beat my favorite language to the punch.

One Comment

  1. Jacek
    Posted August 13, 2005 at 1:12 am | Permalink

    I totally agree. SWT presents a rock solid design and I’d love to be able to use it in Python.