Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Python (http://www.velocityreviews.com/forums/f43-python.html)
-   -   Re: running Lua in Python (http://www.velocityreviews.com/forums/t951702-re-running-lua-in-python.html)

Ian Kelly 09-02-2012 09:24 AM

Re: running Lua in Python
 
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.


All times are GMT. The time now is 11:42 AM.

Powered by vBulletin®. Copyright ©2000 - 2013, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57