Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 22064a4

Browse files
committed
Allow tighter spacing between columns in print_table().
1 parent 4989ff7 commit 22064a4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ def issequence(x):
617617
"Is x a sequence? We say it is if it has a __getitem__ method."
618618
return hasattr(x, '__getitem__')
619619

620-
def print_table(table, header=None, sep=' ', numfmt='%g'):
620+
def print_table(table, header=None, sep=' ', numfmt='%g'):
621621
"""Print a list of lists as a table, so that columns line up nicely.
622622
header, if specified, will be printed as the first row.
623623
numfmt is the format for all numbers; you might want e.g. '%6.2f'.
@@ -632,7 +632,7 @@ def print_table(table, header=None, sep=' ', numfmt='%g'):
632632
sizes = map(maxlen, zip(*[map(str, row) for row in table]))
633633
for row in table:
634634
for (j, size, x) in zip(justs, sizes, row):
635-
print getattr(str(x), j)(size), sep,
635+
print getattr(str(x), j)(size) + sep,
636636
print
637637

638638
def AIMAFile(components, mode='r'):

0 commit comments

Comments
 (0)