GUI suggestions

SNYDER, BARRON F. (AIT) bs1535 at sbc.com
Sun May 27 20:04:10 EDT 2001


Another "GUI/Painter" for wxPython that you should take a look at is
wxDesigner ( http://www.roebling.de/ ). Though it is not free ($89US single
user license), it does a really good job at allowing you to visually layout
your forms quickly. I was a big fan of Tkinter before, but now that I've
been using wxPython, it would be hard to go back! wxPython has a much richer
widget set and seems a bit easier to work with (IMHO).

Barron

-----Original Message-----
From: Alex Martelli [mailto:aleaxit at yahoo.com]
Sent: Saturday, May 26, 2001 4:59 PM
To: python-list at python.org
Subject: Re: GUI suggestions


"Doug Farrell" <writeson at earthlink.net> wrote in message
news:_HTP6.34744$BN6.2065334 at newsread1.prod.itd.earthlink.net...
> Hi,
>
> I'm planning on doing some Python programming at work and the project I'm
> thinking about would be a GUI front end to a C++ command line utility. I
> know about wxPython and GTK+ (and I guess a few others), but does anyone
> have any suggestions or advice on which GUI tool I should invest time in
to
> learn? I'm a strong C++ programmer and pretty good at Windows MFC stuff,
so
> I do know the basics about GUI code.

If the command-line utility you're using is Windows-only, so you don't
mind your GUI front-end also not being cross-platform, you may put
your MFC knowledge to good use (and thus presumably finish your
project faster) by using the Windows-only Pythonwin GUI framework,
as it's basically a Python wrapper over MFC.  I don't think anybody will
argue for MFC being a "great" framework, but, if you already know it,
it may still be fastest for you to re-use that knowledge.

wxPython is also a Python wrapper over a C++ framework, but the
framework is wxWindows, better-designed than MFC (IMHO) _and_
cross-platform.  If you invest time in studying wxPython, the
knowledge you gain will help you in cross-platform development,
even if one day you should unexpectedly find yourself having to
develop a _C++_ cross-platform application.

Tkinter offers the advantage of being "the" classic GUI framework
used in scripting languages (not just Python -- Tk was born for
TCL, and is, AFAIK, the most-used GUI kit for Perl, too).  If you
think one day you might find yourself having to code GUIs in TCL
or Perl, then some knowledge may "cross over" if you get familiar
with Tkinter.  Tkinter is also cross-platform.

wxPython and Tkinter are both free, with licenses similar to
Python's.  I'm not so sure about other cross-platform GUI
frameworks -- depending on your situation, platform, etc,
you may find yourself having to pay money or abide by GPL
restrictions.  If this is no problem for you, fine! -- if it may be
a problem, check out the licensing situation before you commit
time and effort to studying a framework.

Some people swear by GUI-painters.  wxPython has an "early
beta" one, called Boa Constructor, that is free.  I think 'glade'
is similarly free for GTK++.  Other GUI frameworks have
'painter' programs that are commercial -- great if you can
afford to pay, of course, but maybe a stumbling block if
you can't.  For Tkinter, the painter/layout manager is part
of Secretlabs' Python IDE, PythonWorks; for Qt, it's part of
another Python IDE called Blackadder (or you may get it as
part of a Qt license for a couple thousand dollars from Qt's
owners, Trolltech).  If you have funding for SW purchase and
care about IDE's and GUI-painters, you will probably want to
try either or both of these commercial programs -- and their
quality may influence your GUI-toolkit choice.

Tkinter has the edge in terms of documentation, IMHO.  The
stuff that comes with wxPython is good, at least if you know
enough C++ to follow the wxWindows docs it's interleaved
with.  But for Tkinter you can get /F's excellent manual AND
Grayson's book on Python and Tkinter, while there is no book
out on wxPython (nor, I believe, wxWindows either).


Me?  When I need a GUI, I generally put together a bit of
HTML.  On Windows, I can package my application up as
HTA (HTML Application), use Active/X controls, and get as
spiffy as I want.  Cross-platform, my GUIs can't be very
fancy, but deployment flexibility is great -- the 'engine'
need not be running on the same box as the GUI... I like
that!  Python comes with a simple but usable CGI capable
webserver that's easy to adapt to run your scripts behind
the HTML page 'GUI', without actually paying CGI per-hit
costs.  Or you may choose Xitami (with LRWP), Apache
(with mod_python), whatever, for similar benefits.  If your
GUI needs are reasonably simple, comparable to what can
reasonably put on a webpage, you may want to consider
the advantages of this unconventional architecture!

At least you're spoiled for GUI painters, given the surfeit
of HTML editors, free and commercial, you can find...:-)


Alex





More information about the Python-list mailing list