GUIs - A Modest Proposal

Stephen Hansen apt.shansen at gmail.com
Tue Jun 8 10:18:00 EDT 2010


On Tue, Jun 8, 2010 at 6:55 AM, Kevin Walzer <kw at codebykevin.com> wrote:

> I have no opinion on the merits of PyGUI itself, but after taking a quick
> look at the site and the docs, it seems to be an abstraction API over three
> different, platform-specific GUI toolkits--PyObjC (Mac), PyGtk (X11) and
> Windows (pywin32). That means that, whatever its other virtues, it certainly
> is *not* a lightweight GUI toolkit that could easily be incorporated into
> the Python core library--it instead has rather complex dependencies on both
> other GUI toolkits and Python wrappers of those toolkits. (A wrapper of a
> wrapper of a wrapper....)
>

This is sort of incorrect. PyObjC, and pywin32 are not GUI toolkits. They
are the method by which Python accesses the direct platform primitives at a
low level.

PyObjC is shipped with every mac and updated with every version of OSX that
ships, so you really can't consider it a dependency that's a problem. It
exposes to Python the Carbon(eeeh)/Cocoa environment of the system.

Unfortunately, pywin32 is an add-on, and ideally, PyGUI would move to a
pure-ctypes implementation in the future, but still. Its not terribly hard
to replace pywin32 with pure-ctypes -- though its often easier to start with
pywin32.


> In my view, any original, Python-native implementation of a GUI toolkit
> that is small enough to be included in the standard library will wind up
> looking much like Tk. Tk implements its own API on each of the major
> platforms, interfacing directly with the platform primitives at a low level
> (Xlib, Carbon or Cocoa, and win32); it uses native widgets if they map to
> its API and implements its own widgets in other cases. Because it sticks to
> a limited widget set, it's able to to be small.
>

This is exactly what PyGUI does for windows and mac. For linux, it does use
an intermediate layer between xlib and Python-- not sure why, then again?
PyGTK is hardly a complex dependency. Its virtually always simply already
there, in my experience.

--S
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20100608/0c8ace87/attachment.html>


More information about the Python-list mailing list