As the documentation says:
write
(fileobject, space_around_delimiters=True)
Write a representation of the configuration to the specified file object, which must be opened in text mode (accepting strings).
So you problem is, you are missing the file-object argument from the write method:
config = configparser.ConfigParser()
# do some configuration here
with open('settings.ini', 'w') as settings:
config.write(settings) # write to a file