https://refactoring.guru/design-patterns/singleton
- Singleton is a creational design pattern that lets you ensure that a class has only one instance, while providing a global access point to this instance..
- A class of which only a single instance can exist
- Use the Singleton pattern when a class in your program should have just a single instance available to all clients; for example, a single database object shared by different parts of the program.
- Use the Singleton pattern when you need stricter control over global variables.
https://refactoring.guru/design-patterns/singleton#checklist
python main.py
python example.py