ALT+F4 doesn't typically send a SIGKILL
. If you're trying to prevent a process from being killed when its parent shell window is closed, you want something like...
nohup ~/Desktop/left.py &
...to trap the SIGHUP
.
Or you can trap all signals (except SIGKILL
and SIGSTOP
) inside the script itself. Take a look at the Python signal module.