Skip to content
Snippets Groups Projects
Commit 0b04f149 authored by Daniele Nicolodi's avatar Daniele Nicolodi
Browse files

balance: Print table with fixed width columns

parent 4d34810d
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,9 @@ def main():
table = petl.pushheader(balances, ['year', 'account', 'balance']) \
.pivot('account', 'year', 'balance', units, missing='')
# Fix data columns width.
table = table.convert(table.fieldnames()[1:], lambda x: '{:>14s}'.format(str(x)))
print(table)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment