/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
class Singleton(object): def __new__(cls, *p, **k): if not '_the_instance' in cls.__dict__: cls._the_instance = object.__new__(cls) return cls._the_instance