def wrap_text(txt, col = 80):
import re
re.sub("/(.{1,#{col}})( +|$n?)|(.{1,#{col}})/", "13n", txt)
# warning: snipplr tends to escape the quotes and slashes, causing this
# snippet to fail when pasted in.
return txt
Wrap Text to Eighty Columns
Leave a Reply
You must be logged in to post a comment.