I’m trying to get one of the buttons in my game’s main menu to exit the game when clicked. No matter where I looked I couldn’t find anythin that would give me an idea of how to do it.
Finally I found a function when looking through the code of some of the games I’ve got installed on my computer.
It works and gets the job done, but I don’t understand how it does it. I’d really like to know and I haven’t found anything about it so far.
def shutdown():
"""
Perform any cleanup actions in the logging system (e.g. flushing
buffers).
Should be called at application exit.
"""
for h in _handlers.keys():
h.flush()
h.close()
I’d really apreciate it if someone could explain to me just how this function works and more precisely what it actually does.