I want to make a python script do something like post a message before it ends. I tried signal and it works when I type Ctrl+c in cmd window. However, it seems to be inoperative when I just close the cmd window or kill the process from the Windows task manager. So, how can I achieve my goal in the state of the situation above? Thanks for all the suggestions!
source share