En/na Laszlo Nagy ha escrit: > This program: > > import sys > import traceback > import cStringIO > > a = 1.0 > b = 0.0 > try: > c=a/b > except: f = cStringIO.StringIO('') > ei = sys.exc_info() > traceback.print_exception(ei[0],ei[1],ei[2],file=f)
from cStringIO documentation: Another difference from the StringIO module is that calling StringIO() with a string parameter creates a read-only object. Unlike an object created without a string parameter, it does not have write methods. HTH -- http://mail.python.org/mailman/listinfo/python-list