Win32 KeyboardInterrupt

Chris Withers chrisw at nipltd.com
Wed Mar 1 13:20:08 CET 2000


Hi,

I'm trying to use the followingcode to trap a keyboard interrupt:

try:
	if __name__ =='__main__': Worker(sys.argv)
except KeyboardInterrupt:
	print "Saving state..."

It works fine under linux but under Windows NT 4.0:
If I press ctrl-c, nothing happens,
If I press ctrl-break, I get dumpen to the command prompt by the state saving
doesn't get executed...

Any ideas?

Chris

PS: The KeyboardInterrupt key on Win32 is ctrl-c, right? ;-)




More information about the Python-list mailing list