Easiest way to access C module in Python

Lele Gaifax lele at metapensiero.it
Tue Nov 7 08:26:39 EST 2017


bartc <bc at freeuk.com> writes:

> OK, compiling fred.c. Is there a dependency on gcc too? This looks more like
> makefile hell.

That's pretty standard distutils functionality. I'm pretty sure that on
M$Windows it would invoke its C compiler, not gcc.

I wrote "fred.c" to get closer to the case you mentioned, but obviously that
function can very well come from a library.

> People use languages like Python to get away from this stuff.

Which people? The OP explicitly asked for a way to access a C module from
Python, and Cython surely is one option to accomplish that.

ciao, lele.
-- 
nickname: Lele Gaifax | Quando vivrò di quello che ho pensato ieri
real: Emanuele Gaifas | comincerò ad aver paura di chi mi copia.
lele at metapensiero.it  |                 -- Fortunato Depero, 1929.




More information about the Python-list mailing list