# return a configuration objects with default values def myCar_read_config_defaults(config): import configparser if not config.sections(): # there is nothing, lets setup default values config['paths'] = { 'app' : '/opt/myCar', 'log' : 'data/log', 'record' : 'data/rec' } config['connections'] = { 'bt_dev' : '/dev/rfcomm', 'gps_dev' : '/dev/ttyS1', 'wifi_pwd' : 'myCar123' } # return a valid config object either # with or without default values return config