from prettytable import PrettyTable
def outputTable():
x = PrettyTable()
x.field_names = {"a","b","c"}
x.add_row({"1","2","3"})
print(x.get_string())
if __name__ == '__main__':
outputTable()
===== 実行結果 =====
+---+---+---+
| c | b | a |
+---+---+---+
| 1 | 3 | 2 |
+---+---+---+
{{tag>python}}