Yield successive max_rows-sized column chunks from l.
(l, max_rows, row_first=False)
| 614 | #----------------------------------------------------------------------------- |
| 615 | |
| 616 | def _col_chunks(l, max_rows, row_first=False): |
| 617 | """Yield successive max_rows-sized column chunks from l.""" |
| 618 | if row_first: |
| 619 | ncols = (len(l) // max_rows) + (len(l) % max_rows > 0) |
| 620 | for i in range(ncols): |
| 621 | yield [l[j] for j in range(i, len(l), ncols)] |
| 622 | else: |
| 623 | for i in range(0, len(l), max_rows): |
| 624 | yield l[i:(i + max_rows)] |
| 625 | |
| 626 | |
| 627 | def _find_optimal(rlist, row_first=False, separator_size=2, displaywidth=80): |