def wrap_line(line, cols):
    """
    Return an array of line parts, each no longer than cols
    """

    split = [line[i:i + cols] for i in range(0, len(line), cols)]

    # prevent off-by-one if the line length is an exact multiple of cols
    if len(line) % cols == 0:
        split.append('')

    return split