All pastes #99379 Raw Edit

Stuff

public python v1 · immutable
#99379 ·published 2006-07-25 07:54 UTC
rendered paste body
    for text in text_split:        if len(text) > width - 5:            first = 0            last = text[0:(width - 5)].rfind(' ')            tlength = len(text)            while tlength > width - 5:                print '%s' % (center(text[first:last]))                tlength -= len(text[first:last])                first = last                last = text[first:(width - 5) + first].rfind(' ') + first                if text[first:last] > width - 5:                    last = text[first:last - 1].rfind(' ') + first            print '%s' % (center(text[last:]))        else:            print '%s' % (center(text))