Answers for "python ascii table"

2

table to ascii python

# pip install table2ascii (https://pypi.org/project/table2ascii)
from table2ascii import table2ascii

output = table2ascii(
    header=["#", "G", "H", "R", "S"],
    body=[["1", "30", "40", "35", "30"], ["2", "30", "40", "35", "30"]],
    footer=["SUM", "130", "140", "135", "130"],
)

print(output)

"""
╔═════════════════════════════╗
║  #     G     H     R     S  ║
╟─────────────────────────────╢
║  1    30    40    35    30  ║
║  2    30    40    35    30  ║
╟─────────────────────────────╢
║ SUM   130   140   135   130 ║
╚═════════════════════════════╝
"""
Posted by: Guest on June-01-2021
22

python ascii

>>> ord('a')
97
>>> chr(97)
'a'
>>> chr(ord('a') + 3)
'd'
>>>
Posted by: Guest on May-19-2020
0

python ascii()

#changes non_ascii chars to unicode and vice versa
text = 'Pythön is interesting'
print(ascii(text))
#prints 'Pythxf6n is interesting'
Posted by: Guest on March-16-2021

Python Answers by Framework

Browse Popular Code Answers by Language