Author ncoghlan
Recipients ncoghlan
Date 2012-01-25.03:37:14
SpamBayes Score 0.00175415
Marked as misclassified No
Message-id <1327462635.84.0.618726818638.issue13857@psf.upfronthosting.co.za>
In-reply-to
Content
As far I am aware, the simplest way to indent a multi-line string is with the following snippet:

    '\n'.join((4 * ' ') + x for x in s.splitlines())

It would be a lot simpler and clearer if I could just write that as "textwrap.indent(s, 4 * ' ')".

(i.e. indent would accept a prefix string to be inserted before each line in the supplied string, as in the original comprehension)
History
Date User Action Args
2012-01-25 03:37:16ncoghlansetrecipients: + ncoghlan
2012-01-25 03:37:15ncoghlansetmessageid: <1327462635.84.0.618726818638.issue13857@psf.upfronthosting.co.za>
2012-01-25 03:37:15ncoghlanlinkissue13857 messages
2012-01-25 03:37:14ncoghlancreate