Line Breaks

Gary Herron gherron at
Mon Nov 23 20:26:38 CET 2009

Susan Day wrote:
> Hi;
> I have the following line of code I'm sending to postfix:
>   msg = 'A Message From %s:\n\n %s' % (string.replace(customer, '_', ' 
> '), msg)
> Unfortunately, it ignores the line breaks. I also tried %0A but that 
> was ignored also. Please advise.
> TIA,
> Suzie 
 That line does not ignore line breaks.  Proof:
 >>> print 'A Message From %s:\n\n %s' % ('someone','some message')
A Message From someone:

 some message

So...  *Exactly* what are you doing with msg, and *exactly* what is your 
evidence that line breaks are being ignored.  With that information, 
perhaps we can identify and solve the real problem you're having.

Gary Herron

More information about the Python-list mailing list