Skip to content

Instantly share code, notes, and snippets.

View pinkie1378's full-sized avatar

Jeffry Pincus pinkie1378

View GitHub Profile
@pinkie1378
pinkie1378 / format_table.py
Last active November 3, 2016 22:22
3 different ways to format a table.
from itertools import starmap
def format_table(table, delim='|'):
"""
:param list table: 2D list, with inner lists of strings as rows.
:param str delim: Used to define table cell borders.
:return list: Containing formatted string elements representing each row,
ready to be written to a file.
"""