from configparser import ConfigParser, NoSectionError

class ReadConfig(object):
    def get_value(self, section, file):
        try:
            config = ConfigParser()
            config.read(file)
            if not config.has_section(section):
                raise NoSectionError
            return {k:v for k, v in config.items(section)}
        except NoSectionError:
            print('Error. Section [%s] does not exist' % section)
        except FileNotFoundError:
            print('Error. File [%s] does not exist' % file)
        except:
            print('Error while read config file')

if __name__ == '__main__':
    reader = ReadConfig()
    values = reader.get_value('Twitter')
    if values != None:
        for key in values:
            print('%s : %s' % (key, values[key]))