ConfigParser instance has no attribute '__setitem__'
<p>i'm trying to initialize the config file
</p>

<pre><code>import ConfigParser

config = ConfigParser.ConfigParser()
config['Testing'] = {"name": "Yohannes", "age": 10}
with open("test.ini", "w") as configFile: 
    config.write(configFile)
</code></pre>

<p>but it keeps throwing this error </p>

<pre><code>Traceback (most recent call last):
  File "C:\Users\user\workspace\ObjectDetection\src\confWriter.py", line 9, in &lt;module&gt;
    config['Testing'] = {"name": "Yohannes", "age": 10}
AttributeError: ConfigParser instance has no attribute '__setitem__'
</code></pre>

<p>I searched everywhere but didn't find anything</p>

<pre><code>config.Testing = {"name": "Yohannes", "age": 10}
</code></pre>

python python-2.7 file configuration