What's the suggested way to do just before the program ends in Python?
e.g. in c++, I can do something like
struct Cleanup { ~Cleanup() { ..do something..} };
....In some function... {
static Cleanup cleanup; // this will be cleaned when program ends.
}
(I'm not sure whether the way above is a legitimate way in C++ but it seems working for me).