title: What is the benefit of using the ConfigParser instead of a regular python.py file when writing configuration files?
body: <p>I have been using the ConfigParser module to write configuration files for some time. However, a thought recently struck me; why not just use pure Python instead? Take this example configuration file:</p>
  
  <pre><code>[parameters]
  # Host
  host = stackoverflow.com
  port = 22
  </code></pre>
  
  <p>To read these values into my code, I do</p>
  
  <pre><code>import ConfigParser
  config = ConfigParser.SafeConfigParser()
  config.read('host.cfg')
  
  host = config.get('parameters', 'host')
  port = config.get('parameters', 'port')
  </code></pre>
  
  <p>On the other hand, if I had a config file like this:</p>
  
  <pre><code># Host
  host = 'stackoverflow.com'
  port = 22
  </code></pre>
  
  <p>In my main code, I could do this:</p>
  
  <pre><code>from host_cfg import *
  </code></pre>
  
  <p>So what do I gain from using the ConfigParser module? What are the pros and cons of each approach?</p>