def print_columns(lines, spacer='   ', onlydifferent=False):
    '\n    Take a list of lines, each being a list with 3 elements\n    (the three columns to print) and print in 3 columns.\n\n    :param lines: list of 3-element lists, each list is a line and\n    each sub-list are the 3 columns in the line\n    :type lines: list of lists\n    :param spacer: spacer between columns, default 3 spaces\n    :type lines: string\n    :param onlydifferent: only output differing lines\n    :type onlydifferent: boolean\n    '
    s = ''
    clen = [0, 0, 0]
    for l in lines:
        if onlydifferent:
            if (len(l) < 3):
                continue
        for c in xrange(0, 3):
            if (len(str(l[c])) > clen[c]):
                clen[c] = len(str(l[c]))
    line_spec = '{{0:<{1}s}}{0}{{1:<{2}s}}{0}{{2:<{3}s}}\n'.format((' ' * 3), clen[0], clen[1], clen[2])
    for l in lines:
        if ((len(l) > 3) and (l[3] == True)):
            s += red(line_spec.format((DIFF_MARKER + l[0]), str(l[1]), str(l[2])))
        else:
            if onlydifferent:
                continue
            s += line_spec.format(l[0], str(l[1]), str(l[2]))
    return s
Take a list of lines, each being a list with 3 elements
(the three columns to print) and print in 3 columns.

:param lines: list of 3-element lists, each list is a line and
each sub-list are the 3 columns in the line
:type lines: list of lists
:param spacer: spacer between columns, default 3 spaces
:type lines: string
:param onlydifferent: only output differing lines
:type onlydifferent: boolean
def print_columns(lines, spacer='   ', onlydifferent=False):
    '\n    Take a list of lines, each being a list with 3 elements\n    (the three columns to print) and print in 3 columns.\n\n    :param lines: list of 3-element lists, each list is a line and\n    each sub-list are the 3 columns in the line\n    :type lines: list of lists\n    :param spacer: spacer between columns, default 3 spaces\n    :type lines: string\n    :param onlydifferent: only output differing lines\n    :type onlydifferent: boolean\n    '
    s = 
    clen = [0, 0, 0]
    for l in lines:
        if onlydifferent:
            if (len(l) < 3):
                continue
        for c in xrange(0, 3):
            if (len(str(l[c])) > clen[c]):
                clen[c] = len(str(l[c]))
    line_spec = '{{0:<{1}s}}{0}{{1:<{2}s}}{0}{{2:<{3}s}}\n'.format((' ' * 3), clen[0], clen[1], clen[2])
    for l in lines:
        if ((len(l) > 3) and (l[3] == True)):
            s += red(line_spec.format((DIFF_MARKER + l[0]), str(l[1]), str(l[2])))
        else:
            if onlydifferent:
                continue
            s += line_spec.format(l[0], str(l[1]), str(l[2]))
    return s