View Single Post
Guest | Posts: n/a | Thanked: 0 times | Joined on
#7
You know, Python has a built-in module for this, no need to reinvent the wheel:

http://docs.python.org/lib/module-ConfigParser.html


settings.ini:

Code:
[button1]
image=/home/user/browser.png
othersetting=whatever

[button2]
image=/home/user/somethingelse.png

...
Python code:

Code:
import ConfigParser

cfg = ConfigParser.ConfigParser()
cfg.read("settings.ini")

browserpic = cfg.get("button1", "image")

...
 

The Following User Says Thank You to For This Useful Post: