Re: putting the output of a print statement into a string

2005-03-27 Thread Jon Perez
Thanks, man! That was one fast reply... Marc 'BlackJack' Rintsch wrote: > In <[EMAIL PROTECTED]>, Jon Perez wrote: > > >>Question: >> >>Is there a way to somehow put the output of 'print exc_obj' into >>a string? > > > There are ways to do even that, but maybe ``str(exc_obj)`` is enough for > you

Re: putting the output of a print statement into a string

2005-03-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Jon Perez wrote: > Question: > > Is there a way to somehow put the output of 'print exc_obj' into > a string? There are ways to do even that, but maybe ``str(exc_obj)`` is enough for your needs!? Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/l

putting the output of a print statement into a string

2005-03-27 Thread Jon Perez
There are objects whose repr() is not the same 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("[EMAIL PROTECTED]",