This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

CFFI and Python DLL

2 posts · 1611 views

Is it possible to use CFFI to import functions from Python DLLs? (generated by cxFreeze or py2exe)
I know how to load the DLL, but not sure about the further required functions.
e.g you have this function:
def add(x,y):
    return x+y
Don't take the FUN out of DEFUN !

Re: CFFI and Python DLL

I have never tried doing anything like that, but googling doesn't seem to show anything about using those dlls in that way. It looks as if those programs just package the interpreter with the code, which means that functions defined in Python are not exposed in the sense of being directly callable using the C calling convention.

You can probably get to those functions by running Python interpreter as an embedded library in a way analogous to doing so from C. As far as I know there is no working library for this for Common Lisp.