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


Groups > comp.lang.python > #28252

Re: running Lua in Python

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!eweka.nl!hq-usenetpeers.eweka.nl!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'python,': 0.02; 'interpreter': 0.04; 'subject:Python': 0.05; 'json': 0.07; 'purpose.': 0.07; 'scripts': 0.09; 'python': 0.09; 'received:mail- lpp01m010-f46.google.com': 0.09; 'sep': 0.09; 'language': 0.14; 'ideal.': 0.16; 'subprocess': 0.16; 'two.': 0.16; 'wrote:': 0.17; 'module,': 0.17; '(or': 0.18; 'module': 0.19; 'all,': 0.21; 'supposed': 0.21; 'work,': 0.22; 'third-party': 0.23; "haven't": 0.23; 'seems': 0.23; 'header:In-Reply-To:1': 0.25; '(which': 0.26; '[1]': 0.27; 'am,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'run': 0.28; 'embed': 0.29; "i'm": 0.29; 'received:209.85.215.46': 0.30; 'to:addr:python-list': 0.33; 'another': 0.33; 'requirements': 0.33; "can't": 0.34; 'received:google.com': 0.34; 'machines': 0.35; 'process,': 0.35; 'received:209.85': 0.35; 'something': 0.35; 'tool': 0.36; 'stock': 0.36; 'received:209': 0.37; 'far': 0.37; 'data': 0.37; 'subject:: ': 0.38; 'to:addr:python.org': 0.39; 'build': 0.39; 'header:Received:5': 0.40; 'your': 0.60; 'easy': 0.60; 'between': 0.63; 'receive': 0.71; 'interchange': 0.84; 'subject:running': 0.84; 'to:name:python': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=B5nTvWEC1jMDfJGj0EWof0A8EJ8BBFNsZ/2f+Qq1vaE=; b=s/5XSKSknt2rkteUIML2YyFGivDnZyJp9JNcKe1zBWCQYnWcMwEs6cdHiE5NLEvf/6 UlwdDp6VBRDE5ieYC8mIh9yByE1lCXxmUg2CekogUoRsF6KyBtsPPz0101smaEl47Dmb 6VBR3BZwypDoR3LmZz/PjEEclxVoWcdSJt5Cq7e81X4nRsHyl6qUqZMt2qvhcHrSPdNR 1kH0skcXWU/GwK36BniHA6GeJwLOQtNKHYzZkHbywz7RVJ5VwkrI1a9HrVafiJqibQbH 829Ngo2y9WMXqCdPpCatx59yPtZ+eXxLaz3ua72GtDFhAn3vuNJgEZTwnDeE/A9hv8RT OqYw==
MIME-Version 1.0
In-Reply-To <CAJ6cK1ZeBMiD_XkuwgzOo8fKHqM9CBqwe6rMxOo8T0Jj=0h2fw@mail.gmail.com>
References <CAJ6cK1ZeBMiD_XkuwgzOo8fKHqM9CBqwe6rMxOo8T0Jj=0h2fw@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Sun, 2 Sep 2012 03:24:58 -0600
Subject Re: running Lua in Python
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.69.1346577930.27098.python-list@python.org> (permalink)
Lines 21
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1346577930 news.xs4all.nl 6968 [2001:888:2000:d::a6]:38400
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:28252

Show key headers only | View raw


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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web