[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Quality assurance in Python projects containing C modules

NoelByron

3/10/2008 1:09:00 PM

Hello!

We are thinking about writing a project for several customers in
Python. This project would include (among others) wxPython, a C/C++
module. But what happens if this application generates a segmentation
fault on a customers PC. What changes do we have to trace back the
source of the error? Imagine you use two or three C libraries in a
Python project and you experience random crashes in 'Python.exe'. What
would you do?

We intent to target mainly the Windows platform. Is there for example
a way to use 'dbghelp.dll'?

Best regards and thank you!
Noel
20 Answers

Duncan Booth

3/10/2008 2:19:00 PM

0

NoelByron@gmx.net wrote:

> Hello!
>
> We are thinking about writing a project for several customers in
> Python. This project would include (among others) wxPython, a C/C++
> module. But what happens if this application generates a segmentation
> fault on a customers PC. What changes do we have to trace back the
> source of the error? Imagine you use two or three C libraries in a
> Python project and you experience random crashes in 'Python.exe'. What
> would you do?
>
I would start by ensuring that any DLLs you write are written using Pyrex
or Cython: almost always problems with C libraries called from Python are
due to faulty reference counting but if you keep all of your Python related
code in Pyrex/Cython modules the reference counting problem should be taken
care of for you. You can call any required C/C++ code from the Cython code.


Stefan Behnel

3/10/2008 3:09:00 PM

0

Duncan Booth wrote:
> NoelByron@gmx.net wrote:
>> We are thinking about writing a project for several customers in
>> Python. This project would include (among others) wxPython, a C/C++
>> module. But what happens if this application generates a segmentation
>> fault on a customers PC. What changes do we have to trace back the
>> source of the error? Imagine you use two or three C libraries in a
>> Python project and you experience random crashes in 'Python.exe'. What
>> would you do?
>>
> I would start by ensuring that any DLLs you write are written using Pyrex
> or Cython: almost always problems with C libraries called from Python are
> due to faulty reference counting but if you keep all of your Python related
> code in Pyrex/Cython modules the reference counting problem should be taken
> care of for you. You can call any required C/C++ code from the Cython code.

I think the OP meant to use wxPython as an external module, in which case he
has no way of influencing the language it is implemented in.

My personal experience with wxPython has its ups and downs. Specifically when
it comes to crashes, I wouldn't bet my life on it. (but then, the OP aims for
using Windows anyway, so maybe there are ways to hide the crash of wxPython
behind a full-fledged system crash to avoid being blamed...)

Stefan

python

3/10/2008 3:27:00 PM

0

Stefan,

> My personal experience with wxPython has its ups and downs. Specifically when it comes to crashes, I wouldn't bet my life on it. (but then, the OP

I'm new to Python and getting ready to build a small client based
application intended to run on Windows and Linux. I was planning on
using wxPython until I saw your comment above.

Any suggestions on an alternative Python client-side GUI library (pyQT
?) or tips on where I can find out more about wxPython/wxWidget
problems?

Thank you,
Malcolm

Mike Driscoll

3/10/2008 3:36:00 PM

0

On Mar 10, 10:27 am, "Malcolm Greene" <pyt...@bdurham.com> wrote:
> Stefan,
>
> > My personal experience with wxPython has its ups and downs. Specifically when it comes to crashes, I wouldn't bet my life on it. (but then, the OP
>
> I'm new to Python and getting ready to build a small client based
> application intended to run on Windows and Linux. I was planning on
> using wxPython until I saw your comment above.
>
> Any suggestions on an alternative Python client-side GUI library (pyQT
> ?) or tips on where I can find out more about wxPython/wxWidget
> problems?
>
> Thank you,
> Malcolm

We use wxPython here at work for new application development and have
had no major problems with it once we knew what dlls to include. In my
experience, I've needed gdiplus.dll, msvcp71.dll and MSVCR71.dll from
time to time.

Mike

Duncan Booth

3/10/2008 7:03:00 PM

0

Stefan Behnel <stefan_ml@behnel.de> wrote:
> Duncan Booth wrote:
>> I would start by ensuring that any DLLs you write are written using
>> Pyrex or Cython: almost always problems with C libraries called from
>> Python are due to faulty reference counting but if you keep all of
>> your Python related code in Pyrex/Cython modules the reference
>> counting problem should be taken care of for you. You can call any
>> required C/C++ code from the Cython code.
>
> I think the OP meant to use wxPython as an external module, in which
> case he has no way of influencing the language it is implemented in.

The OP mentioned 'two or three C libraries', so I assume wxPython is only
part of the story.

Stefan Behnel

3/10/2008 7:12:00 PM

0

Malcolm Greene wrote:
>> My personal experience with wxPython has its ups and downs. Specifically
>> when it comes to crashes, I wouldn't bet my life on it.
>
> I'm new to Python and getting ready to build a small client based
> application intended to run on Windows and Linux. I was planning on using
> wxPython until I saw your comment above.

Just to make this sound a bit less like FUD: my last experience with wxPython
dates back a couple of years (2004/5?), but back then, we used BoaConstructor
in a project, which crashed a bit too often to do real work with it - and with
crashing I mean crashing Python, not just showing us its blank traceback. So
this was definitely a problem either in wxWindows or in wxPython.

I have no idea how well it works today, but this has definitely forged my
opinion on wxPython.


> Any suggestions on an alternative Python client-side GUI library (pyQT ?)
> or tips on where I can find out more about wxPython/wxWidget problems?

The only other GUI library I used was PyQT3. To me, it has proven to be very
stable, pretty easy to use and feature rich. And from what I read about it,
PyQT4 is supposed to be another lot better and has removed the few API quirks
I found at the time (AFAIR, it finally returns plain Python strings from the
API, for example).

Stefan

Stefan Behnel

3/10/2008 7:15:00 PM

0

Duncan Booth wrote:
> Stefan Behnel <stefan_ml@behnel.de> wrote:
>> Duncan Booth wrote:
>>> I would start by ensuring that any DLLs you write are written using
>>> Pyrex or Cython: almost always problems with C libraries called from
>>> Python are due to faulty reference counting but if you keep all of
>>> your Python related code in Pyrex/Cython modules the reference
>>> counting problem should be taken care of for you. You can call any
>>> required C/C++ code from the Cython code.
>> I think the OP meant to use wxPython as an external module, in which
>> case he has no way of influencing the language it is implemented in.
>
> The OP mentioned 'two or three C libraries', so I assume wxPython is only
> part of the story.

Ah, sorry, I missed that. Sure, if it's about integrating C/C++ libraries as
Python modules, then I second the recommendation of using Cython.

Stefan

Stef Mientki

3/10/2008 7:28:00 PM

0

Stefan Behnel wrote:
> Malcolm Greene wrote:
>
>>> My personal experience with wxPython has its ups and downs. Specifically
>>> when it comes to crashes, I wouldn't bet my life on it.
>>>
>> I'm new to Python and getting ready to build a small client based
>> application intended to run on Windows and Linux. I was planning on using
>> wxPython until I saw your comment above.
>>
>
> Just to make this sound a bit less like FUD: my last experience with wxPython
> dates back a couple of years (2004/5?), but back then, we used BoaConstructor
> in a project, which crashed a bit too often to do real work with it - and with
> crashing I mean crashing Python, not just showing us its blank traceback. So
> this was definitely a problem either in wxWindows or in wxPython.
>
> I have no idea how well it works today, but this has definitely forged my
> opinion on wxPython.
>
>
>
I'm using wxPython for half a year now, and building quit a large /
heavy GUI with it.
And although it's not so easy as Delphi, it's certainly just as stable
as Delphi.

If you're talking about Boa, that's a completely different story,
I tried it on 3 different machines, and couldn't get it working on any
of them.
I think Boa / Dabo / .. are basically good ideas to make programming
wxPython more easy,
and probably a lot of people invested a lot of their free time in the
product with the best intentions,
but unfortunately these programs are not ready for use by others
(specially not for windows users).

I'ld suggest that you download the wxPython demo (with interactive
editor) and see for yourself.

cheers,
Stef

Mike Driscoll

3/10/2008 7:33:00 PM

0

On Mar 10, 2:11 pm, Stefan Behnel <stefan...@behnel.de> wrote:
> Malcolm Greene wrote:
> >> My personal experience with wxPython has its ups and downs. Specifically
> >> when it comes to crashes, I wouldn't bet my life on it.
>
> > I'm new to Python and getting ready to build a small client based
> > application intended to run on Windows and Linux. I was planning on using
> > wxPython until I saw your comment above.
>
> Just to make this sound a bit less like FUD: my last experience with wxPython
> dates back a couple of years (2004/5?), but back then, we used BoaConstructor
> in a project, which crashed a bit too often to do real work with it - and with
> crashing I mean crashing Python, not just showing us its blank traceback. So
> this was definitely a problem either in wxWindows or in wxPython.
>
> I have no idea how well it works today, but this has definitely forged my
> opinion on wxPython.
>
> > Any suggestions on an alternative Python client-side GUI library (pyQT ?)
> > or tips on where I can find out more about wxPython/wxWidget problems?
>
> The only other GUI library I used was PyQT3. To me, it has proven to be very
> stable, pretty easy to use and feature rich. And from what I read about it,
> PyQT4 is supposed to be another lot better and has removed the few API quirks
> I found at the time (AFAIR, it finally returns plain Python strings from the
> API, for example).
>
> Stefan

I agree with Stef. Boa is definitely goofy and while I know some
people swear by it, I see far too many people having issues. I go with
hand coding or XRC. Some also like SPE, but I haven't tried that to
know.

Mike

kperkins257

3/11/2008 12:29:00 AM

0

On Mar 10, 3:33 pm, Mike Driscoll <kyoso...@gmail.com> wrote:
> On Mar 10, 2:11 pm, Stefan Behnel <stefan...@behnel.de> wrote:
>
>
>
> > Malcolm Greene wrote:
> > >> My personal experience with wxPython has its ups and downs. Specifically
> > >> when it comes to crashes, I wouldn't bet my life on it.
>
> > > I'm new to Python and getting ready to build a small client based
> > > application intended to run on Windows and Linux. I was planning on using
> > > wxPython until I saw your comment above.
>
> > Just to make this sound a bit less like FUD: my last experience with wxPython
> > dates back a couple of years (2004/5?), but back then, we used BoaConstructor
> > in a project, which crashed a bit too often to do real work with it - and with
> > crashing I mean crashing Python, not just showing us its blank traceback. So
> > this was definitely a problem either in wxWindows or in wxPython.
>
> > I have no idea how well it works today, but this has definitely forged my
> > opinion on wxPython.
>
> > > Any suggestions on an alternative Python client-side GUI library (pyQT ?)
> > > or tips on where I can find out more about wxPython/wxWidget problems?
>
> > The only other GUI library I used was PyQT3. To me, it has proven to be very
> > stable, pretty easy to use and feature rich. And from what I read about it,
> > PyQT4 is supposed to be another lot better and has removed the few API quirks
> > I found at the time (AFAIR, it finally returns plain Python strings from the
> > API, for example).
>
> > Stefan
>
> I agree with Stef. Boa is definitely goofy and while I know some
> people swear by it, I see far too many people having issues. I go with
> hand coding or XRC. Some also like SPE, but I haven't tried that to
> know.
>
> Mike

SPE is actually a very good editor--I'm using it for all my Python
coding. It integrates well with wxglade, and wxpython, and is built
on wxpython. I've used wxpython on a couple of little projects, and
it works very well (on Linux, anyways). I'm starting a couple of
bigger projects now, and am confident that it will scale up, seeing
some of the projects that are using it.
I've tried Boa a couple of times but, for me, the interface sucks, and
is not very intuitive.