pretty print table python

Solutions on MaxInterview for pretty print table python by the best coders in the world

registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "pretty print table python"
Serena
12 Jul 2017
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"""