Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #28252 > unrolled thread

Re: running Lua in Python

Started byIan Kelly <ian.g.kelly@gmail.com>
First post2012-09-02 03:24 -0600
Last post2012-09-02 03:24 -0600
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: running Lua in Python Ian Kelly <ian.g.kelly@gmail.com> - 2012-09-02 03:24 -0600

#28252 — Re: running Lua in Python

FromIan Kelly <ian.g.kelly@gmail.com>
Date2012-09-02 03:24 -0600
SubjectRe: running Lua in Python
Message-ID<mailman.69.1346577930.27098.python-list@python.org>
On Sun, Sep 2, 2012 at 3:04 AM, Arnaud Delobelle <arnodel@gmail.com> wrote:
> Hi all,
>
> I'm looking for a way to run Lua scripts in Python, and also send and
> receive data between the two.  Something like lunatic-python [1] would
> be ideal.  However, so far I haven't been able to build it on the
> machines it's supposed to run on (macs with OS X Lion) and it seems to
> be dormant.
>
> My requirements are stock OS X Python (which is 2.7) and Lua 5.2.  I'm
> looking for either a way to make lunatic-python work or another tool
> that would do the job.

The simple approach would be to run the Lua scripts with the
subprocess module, using JSON (or something equally accessible) as an
interchange format.

If you need to embed the Lua interpreter in the Python process, and
you can't get an existing third-party module to work, consider rolling
your own C module for the purpose.  My recollection of working with
Lua is that it's a very easy language to embed.

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web