pygtk vs. wxPython

Gerhard Häring gerhard at bigfoot.de
Fri May 17 07:29:16 EDT 2002


* Philip Swartzleonard <starx at pacbell.net> [2002-05-17 11:01 +0000]:
> I've never used pygtk, but i'll just mention that the library stacks on 
> windows would look something like:
> 
> wxpython -- wxwindows -- win32api
> 
> pygtk -- gtk -- win32api

Or pygtk -- gtk -- (gdk -- win32api) on Windows
   pygtk -- gtk -- (gdk -- xlib) on Unix

If you want to make look gtk bloatier ;-)

> Which is a bit more even. Also, aren't there other render-modules for
> wx under linux than the gtk one?

Yes, there's a Motif one, but I've never used it. In CVS, there are also
other flavours like wxUniversal (paints all widgets itself) and backends
targeted at embedded systems using MicroWindows, NanoX, ...

> It's been a while since i played with it, 
> so I'm not really sure anymore-- all i remeber is that wx itself was a 
> gigantic pain to build at the time (or was it the python part that 
> failed... :\ ).

I've had that experience, too. But it works ok now that I've figured it
out. The base configuration usually builds OOTB, but in the default
configuration, it depends on Mesa or OpenGL, which will lead to build
errors if you don't have it installed. Getting accelerated 3D on Linux
is another matter still :-/

> I really don't know if it's appropriate to base this decision on how
> many libraries it takes for you to use the toolkit though...

I agree. I'd also recommend to just try out the demos and actually try
to write a few simple applications with both candidates.

wxPython is still what I prefer, but it needs to be said that you get a
Python binding to a C++ library, with the fault tolerance of the C++
language. Which means that if you do the wrong thing (call methods in
the wrong order, doing stupid things like not creating an application
object first) it will simply crash your Python, with not very helpful
error messages. This is the only part I don't like about wxPython,
because using a high-level language I would expect to get an exception
if I do something stupid, not core dumps. This is especially annoying
when I try stuff out at the interactive prompt, and an interpreter crash
takes my whole session with it.

I also like PyQt, where I never had any crashes. It's possible to write
noncommercial apps with it on Windows, but the wxPython license is more
liberal here.

Gerhard
-- 
mail:   gerhard <at> bigfoot <dot> de       registered Linux user #64239
web:    http://www.cs.fhm.edu/~ifw00065/    OpenPGP public key id AD24C930
public key fingerprint: 3FCC 8700 3012 0A9E B0C9  3667 814B 9CAA AD24 C930
reduce(lambda x,y:x+y,map(lambda x:chr(ord(x)^42),tuple('zS^BED\nX_FOY\x0b')))





More information about the Python-list mailing list