Top "Python-c-api" questions

API used by C and C++ programmers who want to write extension modules or embed Python.

fatal error: Python.h: No such file or directory

I am trying to build a shared library using a C extension file but first I have to generate the …

python gcc python-c-api
Calling a python method from C/C++, and extracting its return value

I'd like to call a custom function that is defined in a python module from C. I have some preliminary …

c++ python c python-c-api python-embedding
ImportError: dynamic module does not define init function (initfizzbuzz)

I tried to compile fizzbuzz.c, in order to import it by python. For building fizzbuzz.c,I used python …

python c python-c-api
Python (and Python C API): __new__ versus __init__

The question I'm about to ask seems to be a duplicate of Python's use of __new__ and __init__?, but regardless, …

python c python-c-api
How to pass flag to gcc in Python setup.py script?

I'm writing a Python extension in C that requires the CoreFoundation framework (among other things). This compiles fine with: gcc …

python distutils python-c-api
Python for .NET "unable to find assembly" error

I'm using CPython and I have a C# dll. I'm trying to use Python for .NET to make them talk. …

python .net interop python-c-api python.net
Extending python with C: Pass a list to PyArg_ParseTuple

I have been trying to get to grips with extending python with C, and so far, based on the documentation, …

python c python-c-api python-c-extension
How To catch python stdout in c++ code

I have a program which during it's run sometimes needs to call python in order to preform some tasks. I …

c++ python redirect python-c-api python-embedding
Py_INCREF/DECREF: When

Is one correct in stating the following: If a Python object is created in a C function, but the function …

python python-c-api
Create an object using Python's C API

Say I have my object layout defined as: typedef struct { PyObject_HEAD // Other stuff... } pyfoo; ...and my type definition: static …

python c python-c-api python-extensions python-embedding