Skip to content

Instantly share code, notes, and snippets.

@steermomo
Created March 28, 2019 07:01
Show Gist options
  • Save steermomo/a9482fa8bc359239107bab5f6d4020c2 to your computer and use it in GitHub Desktop.
Save steermomo/a9482fa8bc359239107bab5f6d4020c2 to your computer and use it in GitHub Desktop.
import sys
def pretty_print(header,col, data, file=sys.stdout):
row_format ="{:<40}" + "{:<15}" * (len(header)) # format
print(row_format.format("", *header), file=file) # print header
for team, row in zip(col, data): # print data part
print(row_format.format(team, *row),file=file)
print('-' * (40 + 15 * len(header)), file=file) # print end line
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment