/ Published in: Python
![](/img/icon_sav.png?v3)
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
Comments
![RSS Feed for Comments RSS Icon](/images/rss.png?v3)