Is wxPython suitable for me

Hi

I am new to wxPython, in fact new to GUI building. I found wxPython
very intuitive and want to use it for my projects. I write most of my
code in C++ or python. Will wxPython allow me to write and link my
code to both these languages and how?

Thanx in advance.

Steve,

Thanx for the reply. Actually, I am going for a cross platform app. The reason I want to use C++ is that I have some performance critical work and heavy computations to do. For this reason I want to deploy CUDA, to parallelize some portions of my code. Visual C provides a very strong means to debug such applications.

Do we have an editor for (wx)Python which supports features like class browsing, auto completion, auto intendation. Would be really helpful in writing some code. I am using PyAlaMode which is simply text editor with some syntax highlighting.

Thanks in advance.

···

On Sat, Jun 19, 2010 at 11:39 PM, GadgetSteve gadgetsteve@live.co.uk wrote:


From: “Vineet Markan” vineet.markan@gmail.com

Sent: Saturday, June 19, 2010 6:26 PM

To: “wxPython-users” wxpython-users@googlegroups.com

Subject: [wxPython-users] Is wxPython suitable for me

Hi

I am new to wxPython, in fact new to GUI building. I found wxPython

very intuitive and want to use it for my projects. I write most of my

code in C++ or python. Will wxPython allow me to write and link my

code to both these languages and how?

Yes - you have 2 choices if you must use both, (personally I would go for pure wxPython or C++ with wxWidgets):

1/ wxPython main loop & GUI calling C++ libraries

2/ C++ main loop linked to and calling (wx)Pyton

in fact since the python can call the C++ and the C++ can call the python you can go round and round the cycle.

At a guess - since you say you are new to GUI building as well as to wxPython - you will probably be looking to have a wxPython GUI that calls some C++ libraries. In that case you will need to build your C++ utilities into a DLL and call it from the Python. For information on building your C/C++ into a DLL see the documentation for your compiler of choice - many modern IDEs make building DLLs quite straight forward. For how to call functions from the DLL see the python, (not wxPython), documentation on ctypes. You will probably also need to look at py2exe, or something similar, to bind your wxPython app into an exe which you can ship with the dll.

(Note that if you are aiming for a target other than windows, i.e. Linux/Unix based, you will need to substitute .so for DLL, executable for .exe and freeze for py2exe in the above - if you are going for cross platform I would strongly suggest going for “pure” (wx)Python as you will not need to compile anything other than the windows distribution using py2exe).

Gadget/Steve

Thanx in advance.

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Vineet Markan

Lead, Operations
Anaya
vineet@anayalabs.com

There are quit a few out there.

I personally use Boa and sometimes UliPad (especially for RST/Sphinx work), but you should really try a few of them out and see which best fits your need.

http://wiki.wxpython.org/wxPythonPit%20Apps

Werner

···

On 20/06/2010 07:59, Vineet Markan wrote:

Steve,

Thanx for the reply. Actually, I am going for a cross platform app. The reason I want to use C++ is that I have some performance critical work and heavy computations to do. For this reason I want to deploy CUDA, to parallelize some portions of my code. Visual C provides a very strong means to debug such applications.

Do we have an editor for (wx)Python which supports features like class browsing, auto completion, auto intendation. Would be really helpful in writing some code. I am using PyAlaMode which is simply text editor with some syntax highlighting.

Steve,

Thanx for the reply. Actually, I am going for a cross platform app. The reason I want to use C++ is that I have some performance critical work and heavy computations to do. For this reason I want to deploy CUDA, to parallelize some portions of my code. Visual C provides a very strong means to debug such applications.

Do we have an editor for (wx)Python which supports features like class browsing, auto completion, auto intendation. Would be really helpful in writing some code. I am using PyAlaMode which is simply text editor with some syntax highlighting.

Thanks in advance.
Vineet,

There have been no end of discussions on this news group regarding preferences for IDEs for python, I personally at the moment am using UliPad - this does do all of the above but also has some odd behaviors the I haven’t quite got a handle on yet - I have found that running it from source produces better results than running the precompiled executable. I have also been trying spyder but an not yet fully up to speed on it - in the past I have also used Code::Blocks and Boa Constructor both of which also have some very good features. A lot of the selection of the tools is a matter of personal preferences take a look at the python wiki at http://wiki.python.org/moin/IntegratedDevelopmentEnvironments for a selection of reviews.

Steve

···

From: Vineet Markan

Sent: Sunday, June 20, 2010 6:59 AM

To: wxpython-users@googlegroups.com

Subject: Re: [wxPython-users] Is wxPython suitable for me

On Sat, Jun 19, 2010 at 11:39 PM, GadgetSteve gadgetsteve@live.co.uk wrote:


From: “Vineet Markan” vineet.markan@gmail.com
Sent: Saturday, June 19, 2010 6:26 PM
To: “wxPython-users” wxpython-users@googlegroups.com
Subject: [wxPython-users] Is wxPython suitable for me

Hi

I am new to wxPython, in fact new to GUI building. I found wxPython
very intuitive and want to use it for my projects. I write most of my
code in C++ or python. Will wxPython allow me to write and link my

code to both these languages and how?

Yes - you have 2 choices if you must use both, (personally I would go for pure wxPython or C++ with wxWidgets):
1/ wxPython main loop & GUI calling C++ libraries
2/ C++ main loop linked to and calling (wx)Pyton
in fact since the python can call the C++ and the C++ can call the python you can go round and round the cycle.
At a guess - since you say you are new to GUI building as well as to wxPython - you will probably be looking to have a wxPython GUI that calls some C++ libraries. In that case you will need to build your C++ utilities into a DLL and call it from the Python. For information on building your C/C++ into a DLL see the documentation for your compiler of choice - many modern IDEs make building DLLs quite straight forward. For how to call functions from the DLL see the python, (not wxPython), documentation on ctypes. You will probably also need to look at py2exe, or something similar, to bind your wxPython app into an exe which you can ship with the dll.
(Note that if you are aiming for a target other than windows, i.e. Linux/Unix based, you will need to substitute .so for DLL, executable for .exe and freeze for py2exe in the above - if you are going for cross platform I would strongly suggest going for “pure” (wx)Python as you will not need to compile anything other than the windows distribution using py2exe).

Gadget/Steve

Thanx in advance.


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Vineet Markan
Lead, Operations
Anaya
vineet@anayalabs.com


To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's
so they can be called directly from the top level pure wxPython GUI
program.

This is why Python and wxPython compiles and runs so fast. It's their
"secret to success". It's a modern counterpart to the "olden days"
when the user interface (no GUI's then) were written in C (no C++,
either) and time-critical code was written in assembly language. I
suspect that in another 15 years top level programs will be written in
a graphics editor and time-critical code will be written in Python due
to Moore's law !

Ray Pasco

···

On Jun 20, 5:57 am, "GadgetSteve" <gadgetst...@live.co.uk> wrote:

From: Vineet Markan
Sent: Sunday, June 20, 2010 6:59 AM
To: wxpython-users@googlegroups.com
Subject: Re: [wxPython-users] Is wxPython suitable for me

Steve,

Thanx for the reply. Actually, I am going for a cross platform app. The reason I want to use C++ is that I have some performance critical work and heavy computations to do. For this reason I want to deploy CUDA, to parallelize some portions of my code. Visual C provides a very strong means to debug such applications.

Do we have an editor for (wx)Python which supports features like class browsing, auto completion, auto intendation. Would be really helpful in writing some code. I am using PyAlaMode which is simply text editor with some syntax highlighting.

Thanks in advance.
Vineet,
There have been no end of discussions on this news group regarding preferences for IDEs for python, I personally at the moment am using UliPad - this does do all of the above but also has some odd behaviors the I haven't quite got a handle on yet - I have found that running it from source produces better results than running the precompiled executable. I have also been trying spyder but an not yet fully up to speed on it - in the past I have also used Code::Blocks and Boa Constructor both of which also have some very good features. A lot of the selection of the tools is a matter of personal preferences take a look at the python wiki athttp://wiki.python.org/moin/IntegratedDevelopmentEnvironmentsfor a selection of reviews.

Steve

On Sat, Jun 19, 2010 at 11:39 PM, GadgetSteve <gadgetst...@live.co.uk> wrote:

--------------------------------------------------
From: "Vineet Markan" <vineet.mar...@gmail.com>
Sent: Saturday, June 19, 2010 6:26 PM
To: "wxPython-users" <wxpython-users@googlegroups.com>
Subject: [wxPython-users] Is wxPython suitable for me

Hi

I am new to wxPython, in fact new to GUI building\. I found wxPython
very intuitive and want to use it for my projects\. I write most of my
code in C\+\+ or python\. Will wxPython allow me to write and link my
code to both these languages and how?

Yes - you have 2 choices if you must use both, (personally I would go for pure wxPython or C++ with wxWidgets):
1/ wxPython main loop & GUI calling C++ libraries
2/ C++ main loop linked to and calling (wx)Pyton
in fact since the python can call the C++ and the C++ can call the python you can go round and round the cycle.
At a guess - since you say you are new to GUI building as well as to wxPython - you will probably be looking to have a wxPython GUI that calls some C++ libraries. In that case you will need to build your C++ utilities into a DLL and call it from the Python. For information on building your C/C++ into a DLL see the documentation for your compiler of choice - many modern IDEs make building DLLs quite straight forward. For how to call functions from the DLL see the python, (not wxPython), documentation on ctypes. You will probably also need to look at py2exe, or something similar, to bind your wxPython app into an exe which you can ship with the dll.
(Note that if you are aiming for a target other than windows, i.e. Linux/Unix based, you will need to substitute .so for DLL, executable for .exe and freeze for py2exe in the above - if you are going for cross platform I would strongly suggest going for "pure" (wx)Python as you will not need to compile anything other than the windows distribution using py2exe).

Gadget/Steve

Thanx in advance\.

\-\-
To unsubscribe, send email to wxPython\-users\+unsubscribe@googlegroups\.com
or visithttp://groups.google.com/group/wxPython-users?hl=en

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visithttp://groups.google.com/group/wxPython-users?hl=en

--

Vineet Markan
Lead, Operations
Anaya
vin...@anayalabs.com

--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visithttp://groups.google.com/group/wxPython-users?hl=en

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's

Also take a look at Cython -- it's a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Thanx for the response. M having a good time exploring capabilities of (wx)Python. Another quick question.

I need to deliver an interface which is highly customizable at run time. Like one of the required features is movable tabs. I mean tabs can be docked onto other panels or separated into other windows. Something in Google Chrome or PhotoShop. I understand wx.aui class supprts tabbing. Does aui has support for this kind of functionality or are there some other viable alternatives??

Thanks in advance.

Vineet

···

On Tue, Jun 22, 2010 at 12:38 AM, Christopher Barker Chris.Barker@noaa.gov wrote:

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython

+Python. All time-critical code can be written in C++ DLL’s and SO’s

Also take a look at Cython – it’s a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

Christopher Barker, Ph.D.

Oceanographer

Emergency Response Division

NOAA/NOS/OR&R (206) 526-6959 voice

7600 Sand Point Way NE (206) 526-6329 fax

Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com

or visit http://groups.google.com/group/wxPython-users?hl=en

Thanx for the response. M having a good time exploring capabilities of (wx)Python. Another quick question.

I need to deliver an interface which is highly customizable at run time. Like one of the required features is movable tabs. I mean tabs can be docked onto other panels or separated into other windows. Something in Google Chrome or PhotoShop. I understand wx.aui class supprts tabbing. Does aui has support for this kind of functionality or are there some other viable alternatives??

Thanks in advance.

Vineet

Hi Vineet,

I am not sure if wx.Aui supports dragging tabs of a tabbed notebook at the moment but AFIK it is pure python so you could add it if it is not there…

Just to tell you nicely, before someone jumps all over you, the prefered convention on this group is “bottom posting” i.e. putting your reply after what you are replying to.

Gadget/Steve

···

From: Vineet Markan

Sent: Tuesday, June 22, 2010 5:03 AM

To: wxpython-users@googlegroups.com

Subject: Re: [wxPython-users] Re: Is wxPython suitable for me

Chris, Cython with wxPython? How does one go about using these two together?

Bob

···

At 03:08 PM 6/21/2010, Christopher Barker wrote:

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's

Also take a look at Cython -- it's a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

Yes, the agw.aui package does support draggable tabs and onto other
panels within the frame. The wxPython demo has an example of this. I
wasn't able to get the demo to drag a tab into its own window, so I
don't know if it can do that or not.

···

On Jun 21, 11:03 pm, Vineet Markan <vineet.mar...@gmail.com> wrote:

Thanx for the response. M having a good time exploring capabilities of
(wx)Python. Another quick question.

I need to deliver an interface which is highly customizable at run time.
Like one of the required features is movable tabs. I mean tabs can be docked
onto other panels or separated into other windows. Something in Google
Chrome or PhotoShop. I understand wx.aui class supprts tabbing. Does aui has
support for this kind of functionality or are there some other viable
alternatives??

Thanks in advance.

Vineet

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Bob Klahn wrote:

Chris, Cython with wxPython? How does one go about using these two together?

In no way special -- use Cython with Python, and wxPython with Python.

You can put python code in Cython, so you could call wxPython directly from it, though I don't that that would give you any advantage.

In theory, you could call wxWidgets C++ from Cython, though I don't know if that would get messy with the SWIG wrappers.

My understanding was that the OP was doing computation code and a GUI -- I was suggesting Cython for the computational part.

-Chris

···

Bob

At 03:08 PM 6/21/2010, Christopher Barker wrote:

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's

Also take a look at Cython -- it's a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I've been working on a substantial wxPython application for some months now, but Python doesn't begin to be fast enough to drive the combinatorics my application requires. I suppose I'm being dense here, but it's not at all clear to me how I can go about combining wxPython, Python, and Cython together ... or, in different words, how I can bring Cython to bear on my wxPython/Python application.

Bob

···

At 02:25 PM 6/22/2010, Christopher Barker wrote:

Bob Klahn wrote:

Chris, Cython with wxPython? How does one go about using these two together?

In no way special -- use Cython with Python, and wxPython with Python.

You can put python code in Cython, so you could call wxPython directly from it, though I don't that that would give you any advantage.

In theory, you could call wxWidgets C++ from Cython, though I don't know if that would get messy with the SWIG wrappers.

My understanding was that the OP was doing computation code and a GUI -- I was suggesting Cython for the computational part.

-Chris

Bob
At 03:08 PM 6/21/2010, Christopher Barker wrote:

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's

Also take a look at Cython -- it's a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

I haven't used Cython yet, but this article will probable give you an
idea of what Chris is talking about:

Basically, you write the stuff that Python is slow at in Cython. Then
you import the Cython module in your Python module and call it from
Python. Thus you get the speed of C/C++ with the cool-factor of
Python!

···

On Jun 22, 2:23 pm, Bob Klahn <bobsto...@comcast.net> wrote:

I've been working on a substantial wxPython application for some
months now, but Python doesn't begin to be fast enough to drive the
combinatorics my application requires. I suppose I'm being dense
here, but it's not at all clear to me how I can go about combining
wxPython, Python, and Cython together ... or, in different words, how
I can bring Cython to bear on my wxPython/Python application.

Bob

-------------------
Mike Driscoll

Blog: http://blog.pythonlibrary.org

Bob Klahn wrote:

I've been working on a substantial wxPython application for some months now, but Python doesn't begin to be fast enough to drive the combinatorics my application requires. I suppose I'm being dense here, but it's not at all clear to me how I can go about combining wxPython, Python, and Cython together ... or, in different words, how I can bring Cython to bear on my wxPython/Python application.

well, what Cython excels at is writing a few functions in C that are easy to access from Python -- and to use numpy arrays efficiently in them.

So you take the core computation code, translate to Cython, tweak for performance, then use those in your wxPython app.

With profiling, you'll probably find that most of your computation time is spent in a handful of functions -- cythonize those, and you're all set.

By the way, a simple google turned up this in the demo code:

http://www.cython.org/release/Cython-0.12/Demos/freeze/combinatorics.pyx

so you're not the only one!

-Chris

PS: Are you using numpy now? If not, do that first, it may take care of your performance issues right there.

···

Bob

At 02:25 PM 6/22/2010, Christopher Barker wrote:

Bob Klahn wrote:

Chris, Cython with wxPython? How does one go about using these two together?

In no way special -- use Cython with Python, and wxPython with Python.

You can put python code in Cython, so you could call wxPython directly from it, though I don't that that would give you any advantage.

In theory, you could call wxWidgets C++ from Cython, though I don't know if that would get messy with the SWIG wrappers.

My understanding was that the OP was doing computation code and a GUI -- I was suggesting Cython for the computational part.

-Chris

Bob
At 03:08 PM 6/21/2010, Christopher Barker wrote:

WinCrazy wrote:

Your top-level program GUI and control can be written in wxPython
+Python. All time-critical code can be written in C++ DLL's and SO's

Also take a look at Cython -- it's a great way to write code that gets compiled to C, but interacts with Python easily.

There are a lot of computational programming folks involve with the project, so you can find others doing using CUDA, etc.

And be sure to check out numpy/scipy

-Chris

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov

In a nutshell, Cython takes Python-like code and generates a module of C code that implements a Python extension module which is then compiled by the C compiler. You could also write your own extension module directly in C if you wish, and although it would probably be much more efficient than the code produced by Cython, it would probably also be much more work for you. Once you have an extension module you just import it and call the functions it provides just like you already do with other extension modules (such as the core of wxPyhton.)

···

On 6/22/10 12:23 PM, Bob Klahn wrote:

I've been working on a substantial wxPython application for some months
now, but Python doesn't begin to be fast enough to drive the
combinatorics my application requires. I suppose I'm being dense here,
but it's not at all clear to me how I can go about combining wxPython,
Python, and Cython together ... or, in different words, how I can bring
Cython to bear on my wxPython/Python application.

--
Robin Dunn
Software Craftsman

Robin Dunn wrote:

In a nutshell, Cython takes Python-like code and generates a module of C code that implements a Python extension module which is then compiled by the C compiler. You could also write your own extension module directly in C if you wish, and although it would probably be much more efficient than the code produced by Cython,

Actually, not really -- with a little care, there is no reason that Cython-generated C is any less efficient than hand-written C.

Cython provides some great tools that let you see what C code is generated by what Cython code, so it's pretty easy to see where you need to add type information, etc. to get clean C code.

it would probably also be much more work for you.

yup!

The great part is that it handles all the ugly stuff for you, and you can carefully tweak only those parts that are the real bottlenecks.

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer

Emergency Response Division
NOAA/NOS/OR&R (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@noaa.gov