title: Python: how to read a config file with only keys (no values)
body: <p>I would like to use the following <code>.ini</code> file with <a href="http://docs.python.org/2/library/configparser.html" rel="noreferrer"><code>ConfigParser</code></a>. </p>
  
  <pre><code>[Site1]
  192.168.1.0/24
  192.168.2.0/24
  
  [Site2]
  192.168.3.0/24
  192.168.4.0/24
  </code></pre>
  
  <p>Unfortunately a call to <code>read()</code> dumps the following error:</p>
  
  <pre><code>import ConfigParser
  c = ConfigParser.ConfigParser()
  c.read("test.ini")
  
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "C:\Python27\lib\ConfigParser.py", line 305, in read
      self._read(fp, filename)
    File "C:\Python27\lib\ConfigParser.py", line 546, in _read
      raise e
  ConfigParser.ParsingError: File contains parsing errors: test.ini
          [line  2]: '192.168.1.0/24\n'
          [line  3]: '192.168.2.0/24\n'
          [line  6]: '192.168.3.0/24\n'
          [line  7]: '192.168.4.0/24\n'
  </code></pre>
  
  <p>My understanding is that the expected format is <code>key = value</code> (a <code>value</code> is required).</p>
  
  <p>My questions:</p>
  
  <ul>
  <li>is <code>ConfigParser</code> usable for such files?</li>
  <li>if not: is there a good alternative to parse similar files?</li>
  </ul>
  
  <p>I can reformat the config file but would like to keep a simple, raw list of entries per section -- as opposed to faking the <code>key = value</code> format with something like <code>range1 = 192.168.1.0/24</code></p>