Created
March 28, 2019 07:01
-
-
Save steermomo/a9482fa8bc359239107bab5f6d4020c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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