Lua动态加载脚本( loadstring )

作者:糖果

下面是代码:

local lua_script = [[
     local var = 1
     print(var)
]]


local  script = lua_script 
local tb=assert(loadstring(script))()
print(tb[0].text)
const char* testfunc = "print (add(1.0, 2.0)) print(sub(20.1, 19))";

int main()
{
        lua_State* L = luaL_newstate();
        luaL_openlibs(L);
        lua_register(L, "add", add);
        lua_register(L, "sub", sub);

        if (luaL_dostring(L, testfunc))
                printf("Failed to invoke.\n");

        lua_close(L);
        return 0;
}

糖果实验室 www.lua.ren/topic/158

糖果

糖果
LUA教程

浅析深度学习神经网络的卷积层

浅析深度学习神经网络的卷积层 Continue reading

NC的文件复制功能

Published on October 10, 2019

Django时区与数据库被锁

Published on October 08, 2019