Configuration file contains sections, each section contains keys and values. configparser module can be used to read and write config files.
Creating the configuration file:-
import configparser
config = configparser.ConfigParser()
config['settings']={'resolution':'320x240',
...