NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.
To learn about what's going on, see About the Archive Site.
I think this question should be posted at: jython-users@xxxxxxxxxxxxxxxxxxxxxYou might also want to search the archives (and perhaps sign up for the mailing list) at:
http://lists.sourceforge.net/lists/listinfo/jython-users tom Campbell, Garrett wrote:
I looked up the jython code to print out the trace when an exception occurs This exception .py will not evec "compile" Any suggestions would be helpful. Thanks copy from example: http://www.python.org/doc/2.1/lib/traceback-example.html import sys, traceback # not acceptible def run_user_code(envdir): source = raw_input(">>> ") try: exec source in envdir except: print "Exception in user code:" print '-'*60 traceback.print_exc(file=sys.stdout) print '-'*60 envdir = {} while 1: run_user_code(envdir) also tried: from sys import traceback def run_user_code(envdir): source = raw_input(">>> ") try: exec source in envdir except: print "Exception in user code:" print '-'*60 traceback.print_exc(file=sys.stdout) # not found print '-'*60 envdir = {} while 1: run_user_code(envdir) G. Garrett Campbell Ph. D. Cooperative Institute for Research in the Atmosphere Colorado State University Ft. Collins, CO, USA 970 491 8497campbell@xxxxxxxxxxxxxxxxxx
-- Tom Whittaker (tomw@xxxxxxxxxxxxx) University of Wisconsin-Madison Space Science and Engineering Center Phone/VoiceMail: 608/262-2759 Fax: 608/262-5974
visad
archives: