[Pythonmac-SIG] GUI design tools

Truls A. Tangstad kerfue+pythonmac-sig at herocamp.org
Wed Mar 9 22:22:49 CET 2005

On Wed, Mar 09, 2005 at 11:42:13AM -0800, Mark Phillips wrote:
> This may be a perennial subject. If this is an oft-repeated request, I 
> sincerely apologize for wasting bandwidth.
> I have a database application I would like to build in Python. I use 
> MacOS X as my primary machine, but historically I have supported old 
> MacOS and Windows machines. This makes it hard for me to abandon the 
> "cross-platform" mindset. I like tools that ease the creation and 
> deployment of applications.
> The ideal solution for me would be a tool set that is similar to 
> popular RAD tools such as 4D, Omnis Studio and the like. Using these 
> have spoiled me rotten as a programmer, and I find myself balking at 
> the installation requirements of the pythonic stuff I have looked at. 
> That is, as I work through the steps I wonder how on earth an end user 
> will deal with this.
> I have experience with OOP, OOA&D and have about 16 years experience 
> writing various stand-alone, client/server and n-tier business 
> applications. I am getting a handle on Python, and I have written a 
> couple of "faceless" applications with it.
> Perhaps I just need a good "not quite a dummy" article, book or 
> something. I have read "Learning Python" and make good use of 
> python.org resources. Still, I haven't found joy with user experience 
> tools yet.
> I would be most grateful for any links or suggestions.

It's not that mature on OS X yet, but I've been developing with
Trolltech's Qt[1] framework using python for quite a while, and really
like it, especially for its cross platform usage. Kevin Walzer has a
binary installer for the libraries[2].

With PyQt i usually program a unit-tested backend with all the
functionality, while creating a nice GUI in Qt's graphical Designer[3]
tool. The files created in the Designer can be loaded runtime by a
simple statement like:

widget = QWidgetFactory.create("mainwindow.ui")

Using Qt's signal/slot system (just a twist on the observer pattern),
you can say which python-functions should respond to which buttons, or
get triggered by which changes of textfields etc.

You can achieve the same effect using GTK's python bindings with the
glade designer and libglade for loading GUIs runtime, and I assume
wxPython works the same way, but I have little experience with GTK and
none with wxPython.

Packaging tools[4] can go a long way at making the end user have an
easy time of an install. Using py2app makes it easy to package the
entire application and its dependencies into one easy to install
application bundle, but you'd have to repeat the procedure on windows
and other operating systems to create OS-specific packages there.
That's one of the reasons it's often easier to create a slim
python-only package that can be run on all operating systems, but then
end up with alot of listed requirements which the end user would have
to fulfill on his/her computer.

As far as learning python goes, I prefer the interactive approach
using the help/dir-functions to see what's available, supplemented by
the official documentation[5]. I've also heard Dive into Python[6]
recommended alot, but haven't read it myself.

I guess the conclusion is that you can achieve the end result you're
after for users, but it's more often done by using a set of
applications/frameworks (eg. qtdesigner, your favourite editor and
py2app) instead of a do-all IDE.

Feel free to correct me if i misunderstood your request.

[1] - http://www.trolltech.com/products/qt/index.html
[2] - http://www.wordtech-software.com/pyqt-mac.html
[3] - http://doc.trolltech.com/3.3/designer-manual-1.html
[4] - http://www.wordtech-software.com/python-applet-tutorial.html
[5] - http://www.python.org/doc/
[6] - http://diveintopython.org/
Truls A. Tangstad - <kerfue+pythonmac-sig at h e r o c a m p.org>

More information about the Pythonmac-SIG mailing list