porting wxpython to wxwidgets

Hi. Im working on a wxpython application and I would like to know the possibilities of porting that code to wxwidgets.

Is there any automatic translator?

Thanks

Hi Fatima,

Hi. Im working on a wxpython application and I would like to know the
possibilities of porting that code to wxwidgets.

Is there any automatic translator?

Not that I know of.
But in any case, why would you do that? I don't see any practical
advantage in porting an entire application from Python to C++. If you
are concerned about the your app performances, please remember that
for UI things no human user will be able to do things faster than your
app can respond.
If there is a critical part in one of my applications that relies on
heavy number crunching, I usually write that (small) part of code in
Fortran and then use f2py to link it with my GUI. If it is a GUI
thing, you can consider the approach used by Paul Lanier with his nice
wx.PseudoDC class, written in C++ and wrapped in wxPython. But that's
for a small part of your GUI, not the entire application.
Other than that, I just leave a famous quote :smiley:

"Every time I think stupid thoughts like, "I'll bet I could do this in
C++," I get out my copy of Scott Meyers' "Effective C++," and I'm quickly
reminded why it's better to stick with Python. -- Mike, comp.lang.python"

And obviously, it's enough to write "import this" at the Python prompt:

"Beautiful is better than ugly."
...
"Simple is better than complex."

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.virgilio.it/infinity77/

···

On 5/25/07, fatima cabot wrote:

fatima cabot wrote:

Hi. Im working on a wxpython application and I would like to know the possibilities of porting that code to wxwidgets.

Is there any automatic translator?

No, but as long as you don't use a lot of Python-specific things it shouldn't be too hard to do it by hand and some text editor search and replace, macros, etc. If you do your Python work with the eventual port to C++ in mind then you'll do things in a more C++-ish way. Then porting something like "wx.Size(w, h)" to C++ becomes just a matter of removing the '.', but if you use the Python shorthand of just using the tuple (w,h) then you'll have to be aware of the context and what is wanted by the code when doing the porting.

On the other hand, I think almost everybody who has talked to me about porting their code to C++ in the past has eventually decided that it didn't need to be done. Andrea has already commented on the reasons why.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!