C
callmebill
I'm having a tough time figuring this one out:
class MyKBInterrupt( ..... ):
print "Are you sure you want to do that?"
if __name__ == "__main__":
while 1:
print "Still here..."
So this thing keeps printing "Still here..." until the user hits ctl-c,
at which time the exception is passed to MyKBInterrupt to handle the
exception, rather than to whatever the built-in handler would be.
I've Read-TFM, but I only see good info on how to create my own class
of exception; I don't see anything on how to override an existing
exception handler.
Thanks in advance for any help.
class MyKBInterrupt( ..... ):
print "Are you sure you want to do that?"
if __name__ == "__main__":
while 1:
print "Still here..."
So this thing keeps printing "Still here..." until the user hits ctl-c,
at which time the exception is passed to MyKBInterrupt to handle the
exception, rather than to whatever the built-in handler would be.
I've Read-TFM, but I only see good info on how to create my own class
of exception; I don't see anything on how to override an existing
exception handler.
Thanks in advance for any help.