slpp
slpp copied to clipboard
Simple lua-python parser
Issue: https://github.com/SirAnthony/slpp/issues/33 Before: ``` >>> lua.decode("""{ SizeZ = .8, }""") {'SizeZ': '.8'} >>> lua.decode("""{ SizeZ = 0.8, }""") {'SizeZ': 0.8} ``` After: ``` >>> lua.decode("{ num = .8, }") {'num':...
If decimals between 0 and 1 are written in shorthand, e.g., .8 rather than 0.8, then they are parsed as strings: `>>> lua.decode("""{ SizeZ = .8, }""")` `{'SizeZ': '.8'}` `>>>...
from slpp import slpp as lua content = '{[0]={0},[1]={3},[2]={6},[3]={9},[4]={12},[5]={15}}' content1 = '{[1]={6},[2]={12},[3]={18},[4]={24},[5]={30}}' table_data_dict = lua.decode(content) table_data_dict1 = lua.decode(content1) print(type(table_data_dict)) # print(type(table_data_dict1)) # print(table_data_dict) # [[0], [3], [6], [9], [12], [15]]...