def print_menu_list(clist, lines=LINES, columns=COLUMNS):
    fmt = "{{:3d}}: {{:{cols}.{cols}}}".format(cols=columns-6)
    if columns > 80:
        fmt2 = "{{:3d}}: {{:{cols}.{cols}}} | {{:3d}}: {{:{cols}.{cols}}}".format(cols=(columns-14)//2)
        h = (len(clist)+1)//2
        i1, i2 = 1, h+1
        for c1, c2 in map(None, clist[:h], clist[h:]):
            if c2:
                print(fmt2.format(i1, str(c1)[-(columns//2)+7:], i2, str(c2)[-(columns//2)+7:]))
            else:
                print(fmt.format(i1, str(c1)[-columns+7:]))
            i1 += 1
            i2 += 1
    else:
        for i, c1 in enumerate(clist):
            print(fmt.format(i+1, str(c1)[-columns+7:]))
Print a list with leading numeric menu choices. Use two columns in necessary.
dataset/ETHPy150Open kdart/pycopia/core/pycopia/cliutils.py/print_menu_list