-- 打印table function print_lua_table (lua_table, indent) if lua_table == nil or type(lua_table) ~= "table" then return end local function print_func(str) XLPrint("[Dongyuxxx] " .. tostring(str)) end indent = indent for k, v in pairs(lua
在lua中,table是比较常用的数据形式,有时候为了打印出里面的内容,需要做一些特殊处理. 废话不多讲,直接粘代码: print = release_print -- 递归打印table local tableDump = function (tab, nesting) end )--获取当前脚本所在的目录 print(string.format("%s : %s",info.source, info.currentline)) local function getStr(value
一.打印table function PrintTable(tb) if type(tb) ~= "table" then print(tb) return end local content = "" local function GetSpace(level) local spaceStr = "" ,level do spaceStr = spaceStr .. " " end return spaceStr end l
openresty开发系列16--lua中的控制结构if-else/repeat/for/while 一)条件 - 控制结构 if-else if-else 是我们熟知的一种控制结构.Lua 跟其他语言一样,提供了 if-else 的控制结构. )单个 if 分支 型 if 条件 then --body end 条件为真 ,执行if中的body ----------------------- x = then print("分支一") end ---- x = ) then print
//提交打印 function sbumitPrint() { printHidden("AppsDSPrintDoub.aspx?type=print"); } function printFrame(frame, onfinish) { if (!frame) frame = window; function execOnFinish() { switch (typeof (onfinish)) { case "string": execScript(onfin
首先看下面的代码: # coding: utf-8 class Test(object): pass print Test.__class__ # type print Test.__base__ # object t = Test() print t.__class__ # Test print t.__class__.__class__ # type print Test.__class__.__class__.__class__ # type a = type('Foo', (), {})