CFFI and Python DLL

Discussion of Common Lisp

CFFI and Python DLL

Postby Indecipherable » Tue Dec 06, 2011 3:12 am

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
Don't take the FUN out of DEFUN !
User avatar
Posts: 47
Joined: Fri Jun 03, 2011 5:30 am
Location: Behind you.

Re: CFFI and Python DLL

Postby Ramarren » Tue Dec 06, 2011 5:55 am

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.
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland

Return to Common Lisp

Who is online

Users browsing this forum: Google [Bot] and 4 guests