On 26/06/06, Claudio Grondi <[EMAIL PROTECTED]> wrote:
Scott David Daniels wrote:
> Claudio Grondi wrote:
> <<<clever stuff to di indentation>>>
>
>> When necessary to skip first line _and_ indentation:
>>   message = """
>>   This is line 1
>>   This is line 2
>>   This is line 3
>>   """.replace('\n  ', '\n')[1:] # adjust here '\n  ' to indentation
>
>
> Riffing on this idea:
>         message = """
>           This is line 1
>           This is line 2
>           This is line 3
>           """.replace("""
>           """, '\n')[1:]

This was intended as an excercise for the OP in case he likes that kind
of solution ...

Claudio

>
> --Scott David Daniels
> [EMAIL PROTECTED]
--
http://mail.python.org/mailman/listinfo/python-list

I've decided to go with

   message = (
       "This is line1. "
       "This is line2 "
       "This is line3\n")

since I'm declaring many different messages inside various functions I feel it is important to keep the indentaion and code both aligned properly so the code looks nice and the output looks nice.

It is easier than doing replace and splicing since I want to keep it as simple and clean as possible, in true pythonic tradition...

Thanks for the input!

-h

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to