table to ascii python

Solutions on MaxInterview for table to ascii python by the best coders in the world

showing results for - "table to ascii python"
Alexander
13 Jul 2019
1# pip install table2ascii (https://pypi.org/project/table2ascii)
2from table2ascii import table2ascii
3
4output = table2ascii(
5    header=["#", "G", "H", "R", "S"],
6    body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
7    footer=["SUM", "130", "140", "135", "130"],
8)
9
10print(output)
11
12"""
13╔═════════════════════════════╗
14║  #     G     H     R     S  ║
15╟─────────────────────────────╢
16║  1    30    40    35    30  ║
17║  2    30    40    35    30  ║
18╟─────────────────────────────╢
19║ SUM   130   140   135   130 ║
20╚═════════════════════════════╝
21"""