Welcome, guest | Sign In | My Account | Store | Cart
from StringIO import StringIO
from traceback import print_exc

try:
   raise Exception

except Exception, e:
    f=StringIO()      # this creates a file object
    print_exc(file=f)
    error_mess = f.getvalue().splitlines()
    print "Damn... Exception Occurred :\n"
    for line in error_mess:
        print line
    dummy = raw_input('Hit Enter........ ') 

History

  • revision 2 (19 years ago)
  • previous revisions are not available