假设我有一个包含2个函数的Lua脚本.我想用Python脚本中的一些参数调用这些函数中的每一个.
我已经看过如何使用Lunatic Python在Python中嵌入Lua代码的教程,反之亦然,但是,我在Python脚本中执行的Lua函数不是静态的,可能会发生变化.
因此,我需要某种方法从.lua文件导入函数,或者只是使用一些参数从Python脚本执行.lua文件并接收返回值.
有人能指出我正确的方向吗?
非常感谢.
我已尝试使用pip install -r requirements.txt在Windows中对python项目的一些要求,但是这仍然失败.经过一番调查后,我发现它因lupa而失败.运行"pip install lupa"会显示与我尝试安装需求时相同的错误,如下面的堆栈跟踪所示:
Collecting lupa
Using cached lupa-1.2.tar.gz
Building wheels for collected packages: lupa
Running setup.py bdist_wheel for lupa: started
Running setup.py bdist_wheel for lupa: finished with status 'error'
Complete output from command d:\development\tools\python\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\Achiraaz\\AppData\\Local\\Temp\\pip-build-g477k1jp\\lupa\\setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" bdist_wheel -d C:\Users\Achiraaz\AppData\Local\Temp\tmped2hn2icpip-wheel- --python-tag cp35:
No local build of LuaJIT2 found in lupa directory
Checking for installed luajit library using pkg-config
pkg-config found luajit version 2.0.4
building without Cython
running bdist_wheel
running build …Run Code Online (Sandbox Code Playgroud) 假设我LuaRuntime使用register_eval=False和创建一个attribute_filter阻止访问除了一些python函数之外的任何东西.假设lua代码无法做到os.system("rm -rf *")或类似的事情是否安全?