Message151932
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) |
|
Date |
User |
Action |
Args |
2012-01-25 03:37:16 | ncoghlan | set | recipients:
+ ncoghlan |
2012-01-25 03:37:15 | ncoghlan | set | messageid: <1327462635.84.0.618726818638.issue13857@psf.upfronthosting.co.za> |
2012-01-25 03:37:15 | ncoghlan | link | issue13857 messages |
2012-01-25 03:37:14 | ncoghlan | create | |
|