config parser python
<p>I have a cfg file which has 10 sections..and each of the section has similar fields.</p>

<pre><code>[sec1]
id:...
[sec2]
id..

...
</code></pre>

<p>So right now.. I am  doing something like..</p>

<pre><code>config_instance = ConfigParser.ConfigParser()
id1 = config_instance.get("sec1","id")
id2 = config_instance.get("sec2","id")
</code></pre>

<p>and so on</p>

<p>Is there a better more pythonic way to do this.. that it automatically reads all the sections and extracts this feature??</p>

<p>Thanks</p>
