def fmtcols(mylist, cols):
    """Generate a string of tab and newline delimited columns from a list
    """
    lines = ("\t".join(mylist[i:i + cols])
             for i in range(0, len(mylist), cols))
    return '\n'.join(lines)