class Singleton(object): __instance = None @classmethod def getInstance(cl): """ Get the global engine instance or create one if none exists yet. """ if cl.__instance is None: cl.__instance = cl() return cl.__instance