Skip to content

Instantly share code, notes, and snippets.

@tonyfast
Created October 2, 2022 04:51
Show Gist options
  • Save tonyfast/abc7748fcc84177b59156d156132aabb to your computer and use it in GitHub Desktop.
Save tonyfast/abc7748fcc84177b59156d156132aabb to your computer and use it in GitHub Desktop.
from importnb import Notebook
@dataclass
class Lua(Notebook):
extensions = ".lua", ".lua.ipynb"
def exec_module(self, module):
from lupa import LuaRuntime
module.lua = LuaRuntime()
module.lua.execute(self.get_source(self.path))
globs = module.lua.globals()
module.__dict__.update(zip(globs.keys(), globs.values()))
return module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment