Questions on using Qt or wxWindows with Python and OS X

Tim Jarman tmj at jLUNCHEON_MEATjarmania.com
Thu Jun 9 15:07:10 EDT 2005


Hi Kenneth!

In article <mailman.272.1117519851.18027.python-list at python.org>,
 Kenneth McDonald <kenneth.m.mcdonald at gmail.com> wrote:

> If this is not an appropriate newsgroup for this type of posting,
> please let me know and (if possible) suggest an alternative. I've
> done a fair bit of research on the net, but information is scattered
> all over the place and I haven't been able to find mailing lists
> relating specifically to python and UIs.
> 

AFAIK there isn't a specific newsgroup/mailing list for Python GUIs in 
general, although perhaps there should be. This is as good a place to 
ask as any, I'd guess.

> I'd like to start using Python for some GUI programming again. I'd
> like to use Tk, but it seems to be dying a slow death, so it's
> probably time to look at wxPython and PythonQt.
> 

If you're ONLY interested in OS X, then you should be aware of PyObjC 
(see http://pyobjc.sourceforge.net/ for details) which will let you 
write Cocoa GUIs directly. (Yes, you probably already know about this, 
but still.) This is probably the best option for OS X only apps, but of 
course it isn't portable to other platforms. 

> I'd appreciate any comments on the relevant merits of these two
> libraries, both with respect to Python and more generally. I know
> about the differences in licensing, that's not an issue. 

I'm currently using wxPython for a moderately large (~ 70K LOC) OS X 
project. The docs aren't bad if you can translate C++ to Python; there 
are also some Python-specific docs coming along (see 
http://www.wxpython.org/docs/api/ ).  There's also a wiki at 
http://wiki.wxpython.org/ which includes a useful cookbook section. The 
demo is the best documentation though, and worth its weight in something 
very valuable.

I have Qt installed on my Mac but haven't played with it much as yet. 
It's generally held to be the best of the cross-platform GUI toolkits 
from a technical POV, modulo licensing issues on Windows, which are 
changing in ways I don't know much about because I don't care about 
Windows, so I can't help you with that. If you do care about Windows, 
though, I know from a previous life that wx looks good on that platform; 
I can't speak to Qt. I have the impression that Qt is more mature/stable 
in general than wx.

There's an online book on PyQt by Boudewijn Rempt (see  
http://www.opendocs.org/pyqt/ ) -  I think it's a bit dated now, but 
still worth a look.

Having said all that, if I were doing my project again I'd use PyObjC.

> My most
> specific concerns are ease of use (which includes how much in the way
> of documentation or examples for using through Python are available,
> and how easy the Python libs are to use in each case); availability of
> a generally capable styled text widget, as one of the things I need to
> build is an editor, which needs to be able to handle different fonts,
> styles, tabs, and so forth; and ease of installation on a Macintosh,
> since that is my preferred dev platform, and installing things made
> for other UNIX variants can be a little wonky at times.
> 

As far as application deployment goes, both wx and Qt are easy to deploy 
on OS X using py2app (included with PyObjC but also available 
separately).

> I'm also curious as to the quality of documentation available for
> wxPython and wxWindows, and any differences between the
> wxWindows text widget (which is generally Scintilla I believe),
> and the Qt text widget classes. I've had a hard time finding good
> docs for wxWindows or wxPython, and the bit of documentation
> on Scintilla I've found and read seems to indicate that it has some
> restrictions, such as needing to use the same line height for all lines
> regardless of content.
> 

See http://www.yellowbrain.com/stc/index.html for the gory details of 
using the Scintilla-based widget. There's also the wxWindows text 
control, which may be sufficient for your needs. (I believe there is 
also a Scintilla-based text widget for Qt.)

I've tried various GUI toolkits looking for text-widget Nirvana, and the 
best I've found is good ol' Tk. Unfortunately Tk/Aqua is still a long 
way from looking lovely IMHO. You might want to check it out all the 
same if text processing is your thing. I'm sure there are people here 
who would disagree that it's "dying a slow death" just yet. ;)


> Many thanks for any feedback you can give.
> 
> 
> Cheers,
> Ken

HTH,

Tim

-- 
Remove luncheon meat to reply.



More information about the Python-list mailing list