as what gets printed out when you apply the
print statement to them. Usually these are
complex objects like exceptions.
Example:
import smtplib server=smtplib.SMTP("smtp.yourisp.com") try: server.sendmail("xx*@in88validdomain.com",
"xx*@abc.com","message")
except smtplib.SMTPRecipientsRefused, senderrs:
exc_obj=senderrs
repr(exc_obj) '<smtplib.SMTPRecipientsRefused instance at 0x00EA7C60>'
print exc_obj
{'xx*@abc.com': (550, 'Verification failed for <xx*@in88validdomain.com>\nunrouteable mail domain "in88validdomain.com"\nSender
verify failed')}
Question:
Is there a way to somehow put the output of 'print exc_obj' into
a string?