forked from Robpol86/terminaltables
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample1.py
More file actions
executable file
·32 lines (24 loc) · 772 Bytes
/
example1.py
File metadata and controls
executable file
·32 lines (24 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env python
"""Simple example usage of terminaltables without any other dependencies.
Just prints sample text and exits.
"""
from __future__ import print_function
from terminaltables import AsciiTable, DoubleTable
table_data = [
['Platform', 'Years', 'Notes'],
['Mk5', '2007-2009', 'The Golf Mk5 Variant was\nintroduced in January 2007 and\nproduced up to March 2009.'],
['MKVI', '2009-2013', 'Might actually be Mk5.'],
]
table = AsciiTable(table_data, 'Jetta SportWagen')
print()
print(table.table)
table = DoubleTable(table_data, 'Jetta SportWagen')
table.inner_row_border = True
table.justify_columns[2] = 'right'
print()
print(table.table)
table.outer_border = False
table.justify_columns[1] = 'center'
print()
print(table.table)
print()