lupa
lupa copied to clipboard
lupa._lupa.LuaError: [string "<python>"]:1: attempt to call a nil value (field 'pow')
trafficstars
lua = lupa.LuaRuntime()
lua_func = lua.eval("function (round) local min = 3 local max = 15 if round >= 3 then min = math.pow(2,3) max = 20 end return min,max end")
print(lua_func(3))
Can't reproduce with Lua 5.4. What's your lua version? (lua.lua_implementation)
>>> lua_func = lua.eval("function (round) local min = 3 local max = 15 if round >= 3 then min = math.pow(2,3) max = 20 end return min,max end")
>>> lua_func(3)
(8.0, 20)
>>> lua.lua_implementation
'Lua 5.4'
lua version is 5.4 OS is Windows python version is 3.7
Can't reproduce
>>> import lupa
>>> lua = lupa.LuaRuntime()
>>> lua_func = lua.eval("function (round) local min = 3 local max = 15 if round >= 3 then min = math.pow(2,3) max = 20 end return min,max end")
>>> print(lua_func(3))
(8, 20)
>>> lua.lua_implementation
'Lua 5.4'
>>> import sys
>>> sys.version_info
sys.version_info(major=3, minor=7, micro=9, releaselevel='final', serial=0)
Thank you. I'll try again