Defining our own signal handler : Signal : Buildin Module PYTHON TUTORIALS


PYTHON TUTORIALS » Buildin Module » Signal »

 

Defining our own signal handler


import time
import signal

def stopsignalNumber, frame ):
   global keepRunning
   keepRunning -= 1
   print "Ctrl-C pressed; keepRunning is", keepRunning

keepRunning = 3

signal.signalsignal.SIGINT, stop )

while keepRunning:
   print "Executing..."
   time.sleep)



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo Buildin Module
» Signal