Lisp HUG Maillist Archive

Lisp to Python interface

I'm using LWW.  I frequently interface C/C++ dll's using the FLI.  Now I'm finding Python programs that I might like to include in my project - I don't know Python, but I'm wondering if  there's some kind of a LWW to Python interface?  Is it possible to interface Python directly?  (Sorry if this is a stupid question.)
 
Bruce.
 
 
 

Re: Lisp to Python interface

Bruce J Weimer MD wrote:

> I don't know Python, but I'm wondering if  there's some kind
> of a LWW to Python interface?  Is it possible to interface Python
> directly?

Maybe Willem Broekema's CLPython library does what you need?
See http://common-lisp.net/project/clpython/, which says:

   CLPython is an open-source implementation of Python written in
   Common Lisp.  With CLPython you can run Python programs in a Lisp
   environment. Libraries written in Lisp are available to Python code,
   and Python libraries can be accessed by Lisp code.

Arthur


Re: Lisp to Python interface

On Sat, May 10, 2008 at 4:39 PM, Bruce J Weimer MD <bjweimer@charter.net> wrote:
I'm using LWW.  I frequently interface C/C++ dll's using the FLI.  Now I'm finding Python programs that I might like to include in my project - I don't know Python, but I'm wondering if  there's some kind of a LWW to Python interface?  Is it possible to interface Python directly?  (Sorry if this is a stupid question.)

There are at least two options for accessing Python libraries from Lisp:

 (1) with Python-on-Lisp you can execute any Python code from Lisp, and receive the results (using CFFI to interface with a normal Python installation)
 (2) with CLPython you can import, compile and run pure Python libraries in Lisp (a reimplementation of Python in Lisp)

Some issues:

- Are those Python libraries written in pure Python, or are there also extension modules written in C? (Only Python-on-Lisp handles those C libraries.)

 - Do you want to run functions in the Python library only for side effects? (Python-on-Lisp might be easier.)

 - Are you interested in accessing Python functions and class instances from within Lisp and vice versa? (CLPython is going in this direction.)

http://common-lisp.net/project/python-on-lisp/
http://common-lisp.net/project/clpython/


- Willem (CLPython)
Updated at: 2020-12-10 08:43 UTC