bini |
A lib to parse and modify bini-files
------------------------------------
The parsed bini is a tuple:
bini = (int,[section])
section = (str,[entry])
entry = (str,[value])
value = int | float | string
------------------------------------
Example:
def negateEmpathy(b):
version, sections = b
for section in sections:
secname, entries = section
for entry in entries:
entryname, values = entry
if entryname == "empathy_rate":
values[1] *= -1
return b
if __name__ == "__main__":
b = readBini("empathy.ini")
writeIni("empathy.ini.txt", b)
writeBini("empathy2.ini", negateEmpathy(b))
print(biniToStr(b))
Functions | ||
|