Sanjay wrote:

> Is somewhere a routine useful to convert a string to lines of maxsize,
> each prefixed with a '>'. This is a typical requirement for 'keeping
> existing text while replying to a post in a forum'.

>>> import textwrap
>>> format = textwrap.TextWrapper(20, initial_indent="] ",
subsequent_indent="] ").fill
>>> print format("alpha beta gamma delta\nepsilon zeta eta theta")
] alpha beta gamma
] delta epsilon zeta
] eta theta

Peter

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

Reply via email to