[EMAIL PROTECTED] wrote: > Hey guys. > > I should warn you, first off, that I'm relatively new to Python. > Basically, what I'm trying to do is create a word-wrapping function > with the added complication that it add a character at the beginning > and end of each line, so that it encloses the text in a sort of 'box': > > ---------------- > | Like this | > ---------------- > > The word-wrapping function I'm working with is similar to the one given > here: > http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/148061 > > Does anyone have any ideas on how it could be modified? Am I > approaching it the right way? Thanks a bunch!
Rather than rewriting wrap(), I would suggest wrapping it with a new function, wrap_box(), that adds the header, line endings and trailer to the lines returned from wrap(). Kent -- http://mail.python.org/mailman/listinfo/python-list