- import PyLuaTblParser as P --this import the PyLuaTblParser module
- parser = P.PyLuaTblParser() --this create a new PyLuaTblParser object
- parser.load(lua_tbl_str) --this load the lua_tbl_str string to python dict or list which stores in parser.data, if the lua_tbl_str is not a valid lua table string, the load function will raise "illegal lua string" error
- parser.loadLuaTable(file_path) --this load the lua table string in file_path to python dict or list(based on the lua table is array or table) as 3 does. if exception occurs duing file operation, the loadLuaTable function will raise "python file io exception" error, if the lua table string is not valid, this function will raise the same error as 3
- lua_tbl_str = parser.dump() --this dump the parser.data to a lua table string which stores in lua_tbl_str
- parser.dumpLuaTable(file_path) --this dump the parser.data to a lua table string in the file which file_path specific, all the previous data in the file will be clear, if exception occurs during the file operation, the dumpLuaTable function will raise "python file io exception" error as 4 does.
- parser.loadDict(d) --this load the python dict to parser.data, this create a deep copy all the (key, value) pair in d if the k satisfy the condition that it's a number or string, the old value in parser.data will be discard
- d = parser.dumpDict() --this dump the parser.data to d, this create a deep copy of parser.data
forked from pkueecslibo/PyLuaTblParser
-
Notifications
You must be signed in to change notification settings - Fork 0
leomoore/PyLuaTblParser
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
python code parse lua table string
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published
Languages
- Python 100.0%