Skip to content

kennu/Lunatic-Python

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About This Fork
===============
Kenneth Falck <kennu@iki.fi> 2011 http://kfalck.net

This is a fork of the original Lunatic-Python that allows creation of
parallel Lua states. If you use the module level functions to execute
Lua code, a default global state is created for them. Otherwise you
can use new_state() to create new states like this:

import lua
state1 = lua.new_state()
state1.globals()['hello'] = 'running in state 1'
state2 = lua.new_state()
state2.globals()['hello'] = 'running in state 2'
state1.execute("print(hello)")
state2.execute("print(hello)")


Lunatic Python
==============

**Lunatic Python** is a two-way bridge between `Python`_ and `Lua`_,
allowing these languages to intercommunicate. Being two-way means that
it allows Lua inside Python, Python inside Lua, Lua inside Python
inside Lua, Python inside Lua inside Python, and so on.

This is an improved version of Lunatic Python 1.0, as written by
Gustavo Niemeyer and available from http://labix.org/lunatic-python .

David M. Cooke (david.m.cooke@gmail.com) has fixed several bugs, and
made this compatible with Python 2.5 and Lua 5.1. The original
documentation is avaiable in the `docs` directory.

The build system has been changed to use `waf`_, which made building
the lua extension easier than using Python's distutils. The `waf`
utility is included.

Building
--------

Using waf:

   $ ./waf configure
   $ ./waf build
   $ ./waf check                # run the tests
   $ ./waf install              # optionally, sudo ./waf install)

The last step will install the python extension in the default
location that distutils would use. The Lua extension is in the 
``build/default`` directory as ``python.so``; this should be copied to the
appropiate place for Lua's .so libraries.

This version of Lunatic Python has currently only been tested on Mac
OS X 10.5, with Python 2.6.1 and Lua 5.1.4. There are some differences
in building the two modules that I'm aware of for other platforms that
I've tried to accommodate, but I haven't tested them.


.. _Python: http://www.python.org/
.. _Lua: http://www.lua.org/
.. _waf: http://code.google.com/p/waf/

About

Lunatic Python is a two-way bridge between Python and Lua. This is a fork that allows multiple Lua states to be created in parallel.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 93.4%
  • Python 5.6%
  • Lua 1.0%