Basic cffi example for python

169 views
Skip to first unread message

Tom McClintock

unread,
Aug 9, 2017, 1:25:44 AM8/9/17
to python-cffi
Hello,

I wrote a very basic tutorial for the other people in my collaboration on how to use cffi to get at some c functions when building a module, allowing the user to not have to deal with actually using cffi at all. In case anyone would find it useful, it's here: https://github.com/tmcclintock/cffi_example. If this is redundant then feel free to delete this post, but I wasn't able to find an example that used this method.

Cheers,
Tom

Armin Rigo

unread,
Aug 9, 2017, 2:23:06 AM8/9/17
to pytho...@googlegroups.com
Hi Tom,

On 9 August 2017 at 07:25, Tom McClintock <tmccli...@gmail.com> wrote:
> I wrote a very basic tutorial for the other people in my collaboration on
> how to use cffi to get at some c functions when building a module, allowing
> the user to not have to deal with actually using cffi at all.

Thanks! A note for other readers: this is using the ABI mode (dlopen)
while still compiling the .so first from setup.py. This is ok, but
the generally recommended way is to use the API mode, i.e. compiling a
cffi-aware .so instead (ffibuilder.set_source). Among other
advantages, it allows the calls to be faster.


A bientôt,

Armin.
Reply all
Reply to author
Forward
0 new messages