Using Python as the config language for a Python program
<p>I'd like to dynamically import various settings and configurations into my python program - what you'd typically do with a .ini file or something similar.</p>

<p>I started with JSON for the config file syntax, then moved to YAML, but really I'd like to use Python. It'll minimize the number of formats and allow me to use code in the config file, which can be convenient.</p>

<p>I hacked up an <code>__import__</code> based system to allow this using code that looks like:</p>

<pre><code>account_config = __import__(settings.CONFIG_DIR + '.account_name', fromlist=[settings.CONFIG_DIR])
</code></pre>

<p>It basically works, but I'm running into all kinds of esoteric problems - eg. if I try to import "test" it picks up some internal python library that's in the python path instead of my test. </p>

<p>So I'm wondering: is using python as the configuration language for a python program viable or am I asking for trouble? Are there examples I can steal from?</p>
