Step By Step(编写C函数的技巧) 1. 数组操作: 在Lua中,"数组"只是table的一个别名,是指以一种特殊的方法来使用table.出于性能原因,Lua的C API为数组操作提供了专门的函数,如: void lua_rawgeti(lua_State* L, int index, int key); void lua_rawseti(lua_State* L, int index, int key); 以上两个函数分别用于读取和设置数组中的元素值…
Timer定时任务 下面是Timer函数的官方doc介绍信息 """ Call a function after a specified number of seconds: t = Timer(30.0, f, args=None, kwargs=None) t.start() t.cancel() # stop the timer's action if it's still waiting """ 第一个参数时指定多长时间之后执行这个函数,…