Skip to content Skip to sidebar Skip to footer
Showing posts with the label Python C Api

How To Use Setuptools Packages And Ext_modules With The Same Name?

I got the following file structure for my Python C Extension project: . ├── setup.py ├── source   … Read more How To Use Setuptools Packages And Ext_modules With The Same Name?

How Do I Use The Correct Dll Files To Enable 3rd Party C Libraries In A Cython C Extension?

I have a C function that involves decompressing data using zstd. I am attempting to call that funct… Read more How Do I Use The Correct Dll Files To Enable 3rd Party C Libraries In A Cython C Extension?

Python C-api Object Allocation

I want to use the new and delete operators for creating and destroying my objects. The problem is p… Read more Python C-api Object Allocation

How To Package A Python C Extension Such That It Is A Submodule Of A Normal Python Module?

I wrote a python library with two parts: A Python C extension A Python wrapper for the Python C ex… Read more How To Package A Python C Extension Such That It Is A Submodule Of A Normal Python Module?

Python C Api Crashes On 'import Numpy' When Initilizing Multiple Times

While working with the Python C API, I found that the python interpreter crashes when initializing … Read more Python C Api Crashes On 'import Numpy' When Initilizing Multiple Times

Python Ctypes: How To Pass Row Outputs From A C Function Into A Pandas Dataframe?

My question is how to parse tab-delimited output from a C function into a pandas DataFrame via ctyp… Read more Python Ctypes: How To Pass Row Outputs From A C Function Into A Pandas Dataframe?

Is It Possible To Cast Dtype Of Scipy Csr Matrix To Npy_float?

I have a scipy CSR matrix that was constructed from a COO matrix as follows: coord_mat = coo_matrix… Read more Is It Possible To Cast Dtype Of Scipy Csr Matrix To Npy_float?

F2py Linking Quadmath Libraries? Use Ctypes For Fortran Wrapper Instead?

Update 11/23/2019: This started out as a question about why I could not get f2py to work for a simp… Read more F2py Linking Quadmath Libraries? Use Ctypes For Fortran Wrapper Instead?

How To Create A Custom Python Exception Type In C Extension?

I'm writing a Python module in C. I need to report errors that can't be described by built-… Read more How To Create A Custom Python Exception Type In C Extension?

How To Tidy/fix Pycxx's Creation Of New-style Python Extension-class?

I've nearly finished rewriting a C++ Python wrapper (PyCXX). The original allows old and new st… Read more How To Tidy/fix Pycxx's Creation Of New-style Python Extension-class?

Pointer-type Mismatch With Pyarray_simplenew

I am creating a module for Python with Numpy using the C API and encounter weird incompatibilities … Read more Pointer-type Mismatch With Pyarray_simplenew

Python C Api - Function Overloading

I have a number of C functions that accept different arguments, e.g. foo_i(int a) foo_c(char c) I… Read more Python C Api - Function Overloading

Memory Leak When Embedding Python Into My Application

The following program, when linked against python 2.7.13 and run on Windows 10 slowly but steadily … Read more Memory Leak When Embedding Python Into My Application

Implementing Nb_inplace_add Results In Returning A Read-only Buffer Object

I'm writing an implementation of the in-place add operation. But, for some reason, I sometimes … Read more Implementing Nb_inplace_add Results In Returning A Read-only Buffer Object

Std::bad_alloc After Replacing Boost:python Function Wrapper With Python/c Api

I had a function in C which I used to extend python, previously using the BOOST_MODULE function to … Read more Std::bad_alloc After Replacing Boost:python Function Wrapper With Python/c Api

Pass Command Line Arguments To Python 2.7.6 Package Application Using C API

I'm new to python and now I need to call a python 2.7.6 program using its C API. The python pro… Read more Pass Command Line Arguments To Python 2.7.6 Package Application Using C API

F2py Linking Quadmath Libraries? Use Ctypes For Fortran Wrapper Instead?

Update 11/23/2019: This started out as a question about why I could not get f2py to work for a simp… Read more F2py Linking Quadmath Libraries? Use Ctypes For Fortran Wrapper Instead?