Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Windows: Catch 'End process' from the Task Manager

Posted on 2006-05-27
3
Medium Priority
?
1,302 Views
Last Modified: 2013-12-03
I can catch control-C from the keyboard, but I don't know how to catch 'End process' from the Task Manager.

Here's what I've tried.  Note, there is no SIGHUP defined in the signal module.

import sys
import signal
def sighandler(signum, frame):
    print 'Killed'
    sys.exit(0)
signal.signal(signal.SIGINT, sighandler)
signal.signal(signal.SIGTERM, sighandler)
signal.signal(signal.SIGABRT, sighandler)
signal.signal(signal.SIGBREAK, sighandler)
# do something in a loop

0
Comment
Question by:todd_pravata
1 Comment
 
LVL 14

Accepted Solution

by:
RichieHindle earned 1000 total points
ID: 16778492
You can't catch End Process, not in Python nor in any other language.  It simply kills the process, without informing it that it's being killed.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Less strange, but still introduction This introduction was added (1st August, 2011) to reflect some reactions.  Firstly, the term basics in the title of the article...  As any other word, it is a symbol with meaning attached to the word by some a…
Installing Python 2.7.3 version on Windows operating system For installing Python first we need to download Python's latest version from URL" www.python.org " You can also get information on Python scripting language from the above mentioned we…
Learn the basics of modules and packages in Python. Every Python file is a module, ending in the suffix: .py: Modules are a collection of functions and variables.: Packages are a collection of modules.: Module functions and variables are accessed us…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question