Building a Python app with Mozilla

Josiah Carlson josiah.carlson at sbcglobal.net
Sat Jun 30 03:19:43 EDT 2007


Thorsten Kampe wrote:
> Hi,
> 
> I've already sent this to the Komodo mailing list (which seemed to me 
> the more appropriate place) but unfortunately I got no response.
> 
> I'd like to build a Python GUI app. Neither Tkinter nor Wxpython nor 
> PyQT are actually what I want (because the lack of GUI builders and 
> they don't really look good on Windows and Linux).

You apparently didn't look very hard.  On the wxPython end of things 
(which I have experience with), there is wxGlade, XRCed, Boa 
Constructor, Dabo, etc.  I don't know about Tkinter (I don't use it), 
but I know that at least Qt has a very nice GUI designer and builder 
(from Trolltech if you are willing to pay for it), and if I remember 
correctly, Eric4 offers some tools to make PyQt editing nice and 
friendly.  I'm sure there are others.

As for wxPython applications not looking good on all platforms; I hate 
to break it to you, but the majority of the controls are *native* on 
whatever platform you happen to be using (except for Qt-based frontends 
in *nix, wxPython uses a Gtk binding in *nix).  Take a browse through a 
few of the applications listed in the wiki: 
http://wiki.wxpython.org/wxPythonPit_Apps , or even Andrea Gavana's 
custom widgets http://xoomer.alice.it/infinity77/eng/freeware.html .


> Komodo itself is an excellent example of a - at least Python driven - 
> application that looks superb and has superior functionality so it 
> seems natural to use the Komodo approach for me.

I could have sworn that Komodo was written in PyQt.  Unless my memory is 
failing me (doubtful, as they at least used to offer some PyQt 
development tools), I would imagine they merely embedded the mozilla 
bits and pieces with some C extensions.

In any case, you really don't want to be developing an application using 
XPI.  According to everyone I've ever talked to about XPI, while getting 
the basic stuff working isn't bad, doing anything worth mentioning is 
about as big a pain in the butt than just writing everything in 8088 
assembly.  You mileage may vary of course.


> * Is there a simple How-To how to build a very simple (Python) app 
> with the Mozilla framework? Kind of "Hello world"...?

Maybe.  Search terms you should use are 'embed XPI python', which give 
me about 189k results in google, some of which seem applicable on the 
first page (which also leads me to believe that my statements regarding 
Komodo embedding mozilla technology may be right, though maybe they 
wrote Komodo in C and Qt).


> * Is is reasonable to think that building a GUI with Mozilla is easier 
> than using Python frameworks because Mozilla does most of the GUI 
> work?

Doubtful.  Building a GUI app with XRCed and wxPython is pretty easy if 
you understand Python and object-oriented programming.  There are some 
annoying vagaries with events, but if you ask your questions on the 
wxpython-users mailing list (over at wxpython.org), one of at least a 
half-dozen people will likely answer your question.


  - Josiah



More information about the Python-list mailing list