No subject


Tue Jun 4 12:00:32 MDT 2013


pp 74-75:
Using the traceback Module to Copy a Traceback to a String
---begin---
import traceback
import StringIO

try:
  raise IOError, "an i/o error occurred:
except:
  fp = StringIO.StringIO()
  traceback.print_exe(file=fp)
  message = fp.getvalue()

  print "failure! the error was:", repr(message)

---end---
Evelyn Mitchell
efm at tummy.com



More information about the FRPythoneers mailing list