How is GUI programming in Python?

David Cook davecook at nowhere.net
Thu Apr 10 05:54:03 EDT 2008


On 2008-04-10, Chris Stewart <cstewart913 at gmail.com> wrote:

> I've always had an interest in Python and would like to dabble in it  
> further.  I've worked on a few very small command line programs but  
> nothing of any complexity.  I'd like to build a really simple GUI app  
> that will work across Mac, Windows, and Linux.  How painful is that  
> going to be?  

With wxpython and pyqt, it can be relatively painless.  You can often just
copy your code directly from one OS to the other and run it, and py2exe
makes it easy to distribute python apps to windows users.  I haven't tried
packaging on OS X (with py2app?).

> I used to be really familiar with Java Swing a few years  
> ago.  I imagine it will be similar.

Yes, the broad principles (event driven, single-threaded event loop) are
pretty much the same.

Note, if you really like Swing, you can use it from Jython.  Your app would
install and look like any other Java app to users (Jython is just another
jar in your distribution), for good or ill.

> Next, what would you say is the best framework I should look into?   
> I'm curious to hear opinions on that.

We use wxPython at work because of the more liberal license.  It's very
capable and works well for us.  

However, for my own projects, I've switched to pyqt, which offers more
complete application help (e.g. things like Actions) and uses MVC from the
ground up rather than as an afterthought.  I also find the pyqt API cleaner
and more consistent; some aspects of wxpython still seem clunky to me.  And
the auto-completion solution offered on the wxPython wiki doesn't work on
Mac, which pretty much killed it for my project.

Dave Cook



More information about the Python-list mailing list