GUI libs
Gerhard Haering
gh at ghaering.de
Fri Apr 25 09:35:45 EDT 2003
Thomas Heller wrote:
> Gerhard Haering <gh at ghaering.de> writes:
>>Mark Nenadov wrote:
>>
>>>Alessio Pace wrote:
>>>
>>
>>>>Hi, I'd like to make a GUI for a program written in python, meant to run
>>>>on mac, win and linux: which is the preferable solution? I saw around
>>>>tkinter, wxpython and pyqt....
>>>
>>>I'd strongly recommend wxPython. wxPython is quite a rich GUI
>>>library and I have found it to be more advanced/modern/feature-rich
>>>than tkinter.
>>
>>
>>You'll get a Python interface with the error behaviour of the wrapped
>>C++ library. The default is to crash. In my limited experience, anyway.
>
> Not for me, but I can only speak for Windows.
On Windows, try this:
C:\>python
Python 2.2.2 (#37, Oct 14 2002, 17:02:34) [MSC 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from wxPython.wx import *
>>> f = wxFrame(NULL, 1, "foo")
>>> f.Show()
This will segfault Python. IIRC, this was what I did in my very first
exploration of wxPython.
I believe the reason of this crash is that the wxWindows main loop isn't
initialized, yet. What I've done may be not very clever, but in my
opinion, a Python app should *never* crash. The whole point of me using
a highly dynamic language like Python is that it will give me exceptions.
The high likelyhood of a wxPython crashing my Python interpreter pretty
much kills the idea of interactively epxloring the framework for me.
Which might not be very useful for a GUI framework, but it's the way I
usually start learning a new Python library.
All this aside, I still prefer wxPython over the alternatives.
-- Gerhard
More information about the Python-list
mailing list