示例#1
0
  ,

  1066


  ,"rosebud"

}}


''')
d = parser.dumpDict()
print d
parser.loadDict(d)
parser["root"][96] = "Hello World"
parser.update({"root":1})
# parser["root"][4] = "Hello World"
parser.dumpLuaTable("output2.lua")
# print "------------------"
parser.loadLuaTable("output2.lua")
sd2 = parser.dumpDict()

print "--------------------------"
print sd2
# print "-------------"
# print parser.dumpLuaTable("table_test.lua")
# # print PythonStrToStruct('''{
# #      "array": [65, 23, 5],
# #      "dict": {
# #           "mixed": {
# #                1: 43,
示例#2
0
    a2.dumpLuaTable('test.txt')
    a3.loadLuaTable('test.txt')

    d3 = a3.dumpDict()
    print d3

    #[],update测试
    print a3['array']
    a3['array'] = 1234
    print a3['array']
    print a3.dumpDict()
    a3.update({
        'array': {
            "one": 1,
            "two": 2,
            "three": 3
        },
        'zjg': 1,
        'yhl': 2,
        'yjs': 3
    })
    print a3.dumpDict()
#附:test_str对应的Python
"""
    dict:
    {
        "array": [65, 23, 5],
        "dict": {
            "mixed": {
                1: 43,
                2: 54.33,
                3: False,