17 lines
274 B
Python
Executable File
17 lines
274 B
Python
Executable File
|
|
|
|
import signal, os, sys
|
|
|
|
import thread
|
|
print thread.get_ident()
|
|
|
|
|
|
def handler(signum, frame):
|
|
print 'Signal handler called with signal', signum
|
|
raise IOError("Couldn't open device!")
|
|
|
|
# Set the signal handler and a 5-second alarm
|
|
signal.signal(4, handler)
|
|
|
|
#signal
|