Thank you for this simple program. It helped me begin to answer a question I had previously posted about trapping "Ctl-C". (see thread: Jythonc Question...)
It turns out that when a Python program is frozen with jythonc, "Ctl-C" will throw an "EOFError" instead of a "KeyboardError".
raw_input("\nEnter or Ctl-C")
print "\n\nKeyboardInterrrupt TRAPPED!"
print "\nKeyboardInterrrupt NOT TRAPPED!"
From: Diez B. Roggisch [mailto:email@example.com]
Sent: Monday, February 09, 2004 9:15 AM
To: Patrick Bielen; Jython Mailinglist
Subject: Re: [Jython-users] Again Look and Feel related
> or is there a better solution ?
You can get the thrown execption from sys.exc_info() like this:
type, value, traceback = sys.exc_info()