How do I bind Python function to Lua function in Lupa or Lunatic

51 Views Asked by At

How can I bind function created in python for use in Lua? In other words I want to make somewhat minimal Lua API in python.
I can use both lupa or lunatic-python.

# foo.py

def foo():
    # Do python stuff like access class defined before this function,
    # use python's lib like socket etc...

-- bar.lua

print("File loaded")
foo()    -- or lupa.foo() or some other combination, I don't know
0

There are 0 best solutions below