import configparser class Config: _instance = None def __new__(cls, *args, **kwargs): if not cls._instance: cls._instance = super(Config, cls).__new__( cls, *args, **kwargs) return cls._instance def __init__(self): self.parser = configparser.ConfigParser() self.parser.read('pywhoisd.conf') # Find a way not to hardcode this