def pprint_list(clist, indent=0, width=74):
    indent = min(max(indent,0),width-1)
    if indent:
        print(" " * indent, end="")
    print("[", end="")
    col = indent + 2
    for c in clist[:-1]:
        ps = "%r," % (c)
        col = col + len(ps) + 1
        if col > width:
            print()
            col = indent + len(ps) + 1
            if indent:
                print(" " * indent, end="")
        print(ps, end="")
    if col + len(clist[-1]) > width:
        print()
        if indent:
            print(" " * indent, end="")
    print("%r ]" % (clist[-1],))
pprint_list(thelist, [indent, [width]])
dataset/ETHPy150Open kdart/pycopia/aid/pycopia/aid.py/pprint_list