How to run a function when user presses “X” in the Python Console?
Clash Royale CLAN TAG #URR8PPP How to run a function when user presses “X” in the Python Console? How do I run a function when user presses "X" button on the python running console? Is the shutdown SIGKILLing your process? If so, there's nothing atexit can do. There's not even anything you could do in C code. SIGKILL can't be handled, blocked, or ignored; the kernel just kills the signalled process without running any further code. – abarnert 15 mins ago atexit SIGKILL Calling atexit.register() as the very last line in your program is kind of pointless - you might as well just call the registered function directly, since it's going to happen immediately anyway. – jasonharper 14 mins ago ...