Import Lua modules directly from within Python
Project description
lua_imports
Import Lua modules directly from within Python.
Basic Usage
Once lua_imports.lua_importer
has been registered, write an import
statement in your Python code, referring to your Lua module.
Example
foo.lua
return {
say_hello = function(person)
print("Hello, " .. person)
end
}
bar.py
import foo
foo.say_hello("World")
Registration
lua_importer
may be registered within Python code:
from lua_imports import lua_importer
lua_importer.register()
(Note that this must come before any Lua imports)
Alternatively, to register lua_importer
environment-wide, create a lua-imports.pth
file in your environment's site-packages
folder with the following contents:
import lua_imports; lua_imports.lua_importer.register()
Caveats
This module wraps Lupa, and so comes with all the same caveats about Lua vs. Python data types.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
lua_imports-1.0.0.tar.gz
(2.0 kB
view hashes)
Built Distribution
Close
Hashes for lua_imports-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | be9e1c73c4faf3f8610ad894bb13e1090457afafb35b525f8ad3b7dd6e0ebabf |
|
MD5 | 8f276c5ef8bcccb50880021b7345b410 |
|
BLAKE2b-256 | b824353ef78e5fdc77fb4e7eede97812084dd4c54ce09caff915c1691c1ddc1b |