首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > Python > 简单的lua的Python数据结构解析

简单的lua的Python数据结构解析

  • 资源大小:5.43 kB
  • 上传时间:2021-06-29
  • 下载次数:0次
  • 浏览次数:1次
  • 资源积分:1积分
  • 标      签: python lua 数据结构 简单 解析

资 源 简 介

Project moved to github. slpp is simple lua-python data structures parser. Lua data check: data = "{ array = { 65, 23, 5 }, dict = { string = "value", array = { 3, 6, 4}, mixed = { 43, 54.3, false, string = "value", 9 } } }"> data = assert(loadstring("return " .. data))()> for i,j in pairs(data["dict"]) do print(i,j) endmixed table: 0x880caf0string valuearray table: 0x880caa0 Parse lua data: >>> from slpp import SLPP>>> lua = SLPP()>>> data = lua.decode("{ array = { 65, 23, 5 }, dict = { string = "value", array = { 3, 6, 4}, mixed = { 43, 54.3, false, string = "value", 9 } } }")>>> print data{"array": [65, 23, 5], "dict": {"mixed": {0: 43, 1: 54.33, 2: False, 4: 9, "string": "value"}, "array": [3, 6, 4], "string": "value"}} Dump python object: >>> lua.encode(data)"{array = {65,23,5,},d

相 关 资 源

您 可 能 感 兴 趣 的

同 类 别 推 荐

VIP VIP
0.213906s