Initial commit

This commit is contained in:
David Beazley
2023-07-16 20:21:00 -05:00
parent 82e815fab2
commit 7d4b30154a
259 changed files with 600233 additions and 2 deletions

View File

@@ -0,0 +1,17 @@
# tableformat.py
# Print a table
def print_table(records, fields):
# Print the table headers in a 10-character wide field
for fieldname in fields:
print('%10s' % fieldname, end=' ')
print()
# Print the separator bars
print(('-'*10 + ' ')*len(fields))
# Output the table contents
for r in records:
for fieldname in fields:
print('%10s' % getattr(r, fieldname), end=' ')
print()