I am using tkinter with python.
Is it possible to execute a certain command (eg. print ("hello")) before closing the window, when close button is pressed?
I am using the close button of the desktop environment (along with maximize and minimize) and not any special close button.
Note that I am asking how to execute a certain command before closing, and not how to close the window (which can already be done with the window buttons). So this is not a duplicate of this question