from textwrap import dedent dedent("""\ this is a multi-line string.""")
will do what you want On Tue, Oct 21, 2008 at 9:58 AM, Lawrence D'Oliveiro <[EMAIL PROTECTED]> wrote: > If triple-quoted strings had the Python-nature, then they would take > indentation into account. Thus: > > """this > is a > multi-line > string.""" > > would be equivalent to > > "this\n is a\n multi-line\nstring." > > and not > > "this\n is a\n multi-line\n string." > > The rule would be: the exact same whitespace characters at the beginning of > the line on which the triple-quoted string starts must also occur at the > start of the lines on which the string continues; these are stripped off > and not included in the string contents. Any additional whitespace is of > course part of the string. > -- > http://mail.python.org/mailman/listinfo/python-list > -- [EMAIL PROTECTED] http://orestis.gr -- http://mail.python.org/mailman/listinfo/python-list