title: Update INI file without removing comments
body: <p>Consider the following INI file:</p>
  
  <pre><code>[TestSettings]
  # First comment goes here
  environment = test
  
  [Browser]
  # Second comment goes here
  browser = chrome
  chromedriver = default
  
  ...
  </code></pre>
  
  <p>I'm using Python 2.7 to update the ini file:</p>
  
  <pre><code>config = ConfigParser.ConfigParser()
  config.read(path_to_ini)
  config.set('TestSettings','environment',r'some_other_value')
  
  with open(path_to_ini, 'wb') as configfile:
      config.write(configfile)
  </code></pre>
  
  <p>How can I update the INI file without removing the comments. The INI file is updated but the comments are removed.</p>
  
  <pre><code>[TestSettings]
  environment = some_other_value
  
  [Browser]
  browser = chrome
  chromedriver = default
  </code></pre>