However writing a parser for configuration files takes time, and the standard ones (.ini and .xml) have their limitations. Lucky for us each Python program comes with the full interpreter bundled. We can do stuff like:
from sys import platform
if platform == "win32":
APP_HOME = "c:\\my_cool_app"
APP_HOME = "/opt/my_cool_app"
__import__in our application we can load the configuration file and parse it without a sweat:
settings = __import__("settings.py")
To view this approach taken to extreme, have a look at http://www.unixreview.com/documents/s=9133/ur0404e/