包含C模块的Python项目的质量保证 [英] Quality assurance in Python projects containing C modules

查看:90
本文介绍了包含C模块的Python项目的质量保证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!


我们正在考虑为几个客户编写一个项目,价格为
Python。该项目将包括(其中包括)wxPython,一个C / C ++

模块。但是,如果此应用程序在客户PC上生成分段

故障会发生什么。我们有什么变化来追溯错误的

来源?想象一下,你在一个

Python项目中使用了两个或三个C库,你会遇到''Python.exe'中的随机崩溃。什么

你会做什么?


我们主要针对Windows平台。有没有例如

a方式使用''dbghelp.dll''?


祝你好运,谢谢!

Noel

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

推荐答案

没有******* @ gmx.net 写道:
No*******@gmx.net wrote:

您好!


我们正考虑为多个客户编写项目在

Python中。该项目将包括(其中包括)wxPython,一个C / C ++

模块。但是,如果此应用程序在客户PC上生成分段

故障会发生什么。我们有什么变化来追溯错误的

来源?想象一下,你在一个

Python项目中使用了两个或三个C库,你会遇到''Python.exe'中的随机崩溃。什么

你会做什么?
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?



我首先要确保你写的任何DLL是用Pyrex写的

或Cython:由于错误的引用计数,几乎总是出现来自Python调用的C库的问题是

但是如果你在Pyrex / Cython模块中保留所有与Python相关的
代码应该采取引用计数问题

照顾你。您可以从Cython代码中调用任何所需的C / C ++代码。

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.


Duncan Booth写道:
Duncan Booth wrote:
No ******* @ gmx.net 写道:

>我们正在考虑为Python中的几个客户编写项目。该项目将包括(其中包括)wxPython,一个C / C ++
模块。但是,如果此应用程序在客户PC上生成分段错误,会发生什么。我们有什么变化来追溯错误的来源?想象一下,你在一个
Python项目中使用了两个或三个C库,你会遇到''Python.exe'中的随机崩溃。你会做什么?
>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?



我首先要确保你编写的任何DLL是使用Pyrex

或Cython编写的:由于错误的引用计数,从Python调用的C库几乎总是出现问题,但如果你在Pyrex / Cython模块中保留所有与Python相关的
代码引用计数问题应该采取

照顾你。您可以从Cython代码中调用任何所需的C / C ++代码。

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.



我认为OP意味着使用wxPython作为外部模块,在这种情况下他/ b $ b无法影响它的语言已经实现了。


我对wxPython的个人经历有其起伏。特别是当它发生崩溃时,我不会打赌我的生命就此消失。 (但是,无论如何,OP的目标是使用Windows来支付
,所以也许有办法隐藏wxPython崩溃

背后的全面系统崩溃以避免被指责......)


Stefan

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


Stefan,
Stefan,

我对wxPython的个人经历有其起伏。特别是当涉及崩溃时,我不会打赌我的生活。 (但是,OP
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



我是Python的新手,并准备构建一个基于小客户端的

应用程序,用于运行在Windows和Linux上。我在使用wxPython计划

,直到我看到你的评论为止。


关于替代Python客户端GUI库的任何建议( pyQT

?)或者我在哪里可以找到更多关于wxPython / wxWidget的提示

问题?


谢谢,

Malcolm

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


这篇关于包含C模块的Python项目的质量保证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆