config = ConfigParser.ConfigParser()
config.readfp(open('settings.conf'))
categories = config.get('syndication', 'categories').strip().split('\n')
categories.append('Category 4')
config.set('syndication', 'categories', '\n' + '\n'.join(categories))
config.write(open('settings.conf', 'w'))
How to create an array or list in a default.conf file