Page 1 of 1

CFFI and Python DLL

Posted: Tue Dec 06, 2011 3:12 am
by Indecipherable
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:

Code: Select all

def add(x,y):
    return x+y

Re: CFFI and Python DLL

Posted: Tue Dec 06, 2011 5:55 am
by ramarren
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.