Easiest way to access C module in Python

Chris Angelico rosuav at gmail.com
Tue Nov 7 06:16:46 EST 2017


On Tue, Nov 7, 2017 at 10:06 PM, bartc <bc at freeuk.com> wrote:
> On 07/11/2017 02:23, Chris Angelico wrote:
>>
>> On Tue, Nov 7, 2017 at 12:52 PM, bartc <bc at freeuk.com> wrote:
>
>
>>> Cython seems very confusing to me.
>>
>>
>
>>
>>> Otherwise what /I/ would look for is ways to call C functions inside
>>> shared
>>> libraries (.dll and .so). That requires that the modules under test be
>>> wrapped as a shared library, which may be extra effort (but it will still
>>> be
>>> using C, so with familiar tools and no crossover with Python at this
>>> point).
>>>
>>> To call shared library C functions from Python I think involves the
>>> ctypes
>>> module (I've never done it). Googling 'ctypes shared library' gives some
>>> promising results.
>>
>>
>> The point of Cython is to make this easier. It's worth learning.
>
>
> My experience is different.

Thanks for the FUD. I love it when someone, on the basis of one failed
experiment, trash-talks an excellent piece of software that would
solve the OP's problem.

ChrisA



More information about the Python-list mailing list