parser.add_section('test')
parser.set('test', 'option', 'Spam spam spam!')
parser.set('test', 'more options', "Really? I can't believe it's not butter!")
parser.write(f)
Использование двоеточий в ConfigParser Python