Python 打印表格

Ghlerrix2022/05/12postsposts

使用Python在终端打印出好看的表格

from prettytable import PrettyTable
table = PrettyTable(['Title1', 'Title2', 'Title3'])

table.add_row([1, 2, 3])
table.add_row([4, 5, 6])

print(table)

效果:

image-20241112112129698

最后更新时间 11/21/2024, 2:02:30 PM