style question

Claudio Grondi claudio.grondi at freenet.de
Mon Jun 26 19:55:43 CEST 2006


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
> scott.daniels at acm.org



More information about the Python-list mailing list