python-c-api
PyArg_ParseTuple SegFaults in CApi
I am writing a code, trying to get used to the C API of NumPy arrays. #include <Python.h> #include \"numpy/arrayobject.h\"[详细]
2023-04-13 01:44 分类:问答typecasting PyArrayObject data to a C array
I want to work with my Numpy arrays in a C extension. Many examples in this case uses the structure of PyArrayObject,[详细]
2023-04-12 08:56 分类:问答PyArray_BOOL declaration & working with Numpy array of bools in C extension
I have a NumPy array of bools in my code that I wish to write a C extension to. When I try to get a contiguous array in order to use in my C routine, I use:[详细]
2023-04-12 08:42 分类:问答Why do Python functions get garbage collected?
I have a C++ library which uses Python call开发者_开发问答backs. The callback, i.e. PyObject*, is stored in an object of class UnaryFunction, and the constructor Py_INCREFs it. The destuctor Py_XDECRE[详细]
2023-04-03 04:26 分类:问答Embedding Python into C - importing modules
I am having problems using the Embedded Python for C as per the Documentation - Whenever I try using imported modules I get an :[详细]
2023-04-01 20:00 分类:问答Calling external function from DLL with PowerBuilder 10.0 error
I have created a DLL using Visual C++ 2008 that creates two external functions.Using python I have created two separate executable functions to run these.When using PowerBuilder to call the function,[详细]
2023-04-01 07:01 分类:问答Python: Usage of PyDateTime_FromTimestamp
I\'m working on a python c-extension and want to create an instance of python datetime object with a unix timestamp.[详细]
2023-04-01 03:01 分类:问答Reversing axis in Numpy array using C-API
I am using the Python C-API to wrap some C++ code as a Python package. In the end, I have to reverse an axis in a numpy array, i.e. doing[详细]
2023-03-26 17:50 分类:问答How to check if PyObject* points to the type numpy.uint8
How do I use the Python C-API to check if a PyObject* points to the type numpy.uint8 etc? (N开发者_运维知识库ote that I want to check if the PyObject* points to the type numpy.uint8, not if it point[详细]
2023-03-23 03:33 分类:问答Build a PyObject* from a C function?
I am embedding Python in a C++ library which I am making. I would like users to be able to pass C functions in the form of function pointers PyObject* (fpFunc*)(PyObject*,PyObject*); so that I can use[详细]
2023-03-19 02:10 分类:问答