ユーザ用ツール

サイト用ツール


サイドバー

このページの翻訳:



最近の更新



Tag Cloud

15_python:01_prettytable

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 |
+---+---+---+
15_python/01_prettytable.txt · 最終更新: 2019/03/26 22:09 by matsui