1

I'm new to Python and using Pycharm. I have an application in Python and I wan't to be able to import Lua files and use them(the functions, variables and etc.) from within Python. Searching in google I found this website "https://pypi.org/project/lua-imports/" and it seems possible. According to this page, "lua_importer" moudle may be registered within Python code. Can you please explain me how to register it properly? I barely found information about this issue and no matter what I do, when I'm trying to import a Lua file Python doesn't recognize it. Thank you :)

I tried to import lua files and be able to run lua functions from within Python.

Tamar
  • 11
  • 1
  • Why do you think Python can recognize Lua files? – user253751 Jan 18 '23 at 17:00
  • 1
    Short answer: No. Lua is not Python and Python is not Lua. Not so short answer: You can use bindings to a Lua interpreter - or, theoretically, a Lua interpreter written in Python - to execute Lua from Python. – Luatic Jan 18 '23 at 17:19
  • First you should add the module `lua_imports` to your Python. – ESkri Jan 19 '23 at 07:00
  • `lua_imports` seems to be buggy. It successfully found `foo.lua` module, but failed to get its content: `AttributeError: 'tuple' object has no attribute 'say_hello'` – ESkri Jan 19 '23 at 07:25
  • Try to use [Lupa](https://github.com/scoder/lupa) directly, without `lua_imports` – ESkri Jan 19 '23 at 09:33

0 Answers0