Sanjay wrote: > Hi All, > > 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'. > > It can be developed, but if something obvious is already there(I being > new to python might not be aware), than it would be great just to reuse > it! > > thanks > sanjay >
def fixlines(stuff) : for line in stuff.split(line_separator) : for chunkstart in range(0,len(line),maxsize) : yield prefix + line[chunkstart:chunkstart+maxsize] -- http://mail.python.org/mailman/listinfo/python-list