====== 01 PrettyTable ====== $ pip3 search PrettyTable PrettyTable (7) - A simple Python library for easily displaying tabular data in a visually appealing ASCII table format. 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}}