title: Handling duplicate keys with ConfigParser
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/5396144/python-config-parser-duplicate-key-support">Python Config Parser (Duplicate Key Support)</a>  </p>
  </blockquote>
  
  
  
  <p>I'm trying to read an INI format project file in Python. The file contains duplicate keys (having unique values) within a section. For example, one of the sections looks like this:</p>
  
  
  
  <pre class="lang-py prettyprint-override"><code>[Source Files]
  Source="file1.c"
  Source="file2.c"
  Source="file3.c"
  </code></pre>
  
  <p>If I read this using the following code</p>
  
  <pre class="lang-py prettyprint-override"><code>config = configparser.ConfigParser( strict=False )
  config.read( "project/file/name" )
  print( config.get( "Source Files", "Source" ) )
  </code></pre>
  
  <p>the result is</p>
  
  <pre class="lang-py prettyprint-override"><code>"file3.c"
  </code></pre>
  
  <p>Is there any way to get a list of all the values for the key <code>Source</code> instead? I'm open to using some other method to parse the file.</p>
  
  <p>Note that I cannot change the file format.</p>