[wxPython] Re: wxWindows + Python or wxPython ?

Hi all,

These are my responses to everyone else's responses:

1. Port the app to wxWindows and embed the Python interpreter.
2. Port the app to wxPython.

You're not really faced with a one or the other choice here. Python is
both extendable and embedable, and there is nor reason that it can't be
both at once. In fact, I'm having a hard time imagining a usefull app
that would imbed Python without extending it so that it can interoperate
with that app. What I'm getting at is that you do have to chooose
between straight Python and a C++ app with Python embedded in it, but
once you have Python imbedded, you can write any amount of the
functionality of your app in Python. I've seen it written that a Python
interpreter imbedded in a wxWindows app can use wxPython, so you could
have full GUI access from Python too (Does anyone here have an example
of that?).

Pros of using wxWindows + Python:

Existing C++ code can be used as is.

Only the non-GUI part. Is that most of it?

Users don't have to install Python.
Easier to create and install app.exe.

There are ways to build a single executable from a Python app. From the
messages I see, it's not trivial(except on the Mac), but it can be done.

More classes available on wxWindows (not important for my app).

You could always wrap any missing classes anyway. What's missing that's
not allready available in Python anyway?

A Mac version of wxWindows exists (sort of).

Which means a Mac version of wxPython shouldn't be all that hard.
(emphasise the shouldn't !) Are you an experienced Mac programmer? There
has been a lot of interest in the Mac port on the wxPython and MacPython
mailing lists. I think if someone gets it started, they will get help.

Pros of using wxPython:

Python code is simpler and possibly better.

But of course!

Python is the wave of the future, etc.

I'd like to think so.

Better widgets may be available w/ Python.

??? I wish it were true, but if wxWindows doesn't have it, neither does
wxPython (except contributed derived widgets, but there are those for
wxWindows, as well.

Easier to add scripting support.

yes

Easier to use existing scripts.

yes

Vadim Zeitlin wrote:

the sad truth is that C/C++ is still better
than Python for cross platform applications (and not the
contrary)

I disagree. Python is a VERY platform independent language. The
interpeter needs to have been ported to your platforms of choice, but it
already has been ported to many more platforms that wxWindows anyway.
You can even run Python code on a Java Virtual Machine with JPython (of
course you would lose wxWindows, but I'm making a point about
portability)

sooner or later you will need something which
wxWin/wxPython doesn't have and at that moment you may still
use it from a C++ program but it's more delicate from Python.

Well, that might be MUCH later, depending on your application. My
experience is that the only thing I need to extend Python for is low
level functionality (You're not going to write a driver with Python) and
speed. A number of extensions have already been written to speed up
common functions, so you could very well never need to do it all.

Besides, even if you end up having to write a few classes in C++ and
wrap them for Python, if the other option is C++, you havn't lost much
at all. If you do have to do this, you won't be any more portable that
the C++ you write, but not less portable either.

I vote for a mixture of Python and C++. It does seema bit silly to toss
all your C++ code, and as you work you will find which works best in
which situation.

-Chris

PS: do the wxMacPython port!!!

ยทยทยท

--
Christopher Barker,
Ph.D.
cbarker@jps.net --- --- ---
http://www.jps.net/cbarker -----@@ -----@@ -----@@
                                   ------@@@ ------@@@ ------@@@
Water Resources Engineering ------ @ ------ @ ------ @
Coastal and Fluvial Hydrodynamics ------- --------- --------
------------------------------------------------------------------------
------------------------------------------------------------------------