python-AsciiTable

1、AsciiTable

AsciiTable是最简单的表。它使用+|-字符来构建边框。

绘制使用普通的ASCII字符,如桌子+|-

2、安装

Pip Install

The easiest way to get terminaltables is to use pip. Simply run this command.

pip install terminaltables

Latest from GitHub

You can also elect to install the latest bleeding-edge version by using pip to install directly from the GitHub repository.

pip install git+https://github.com/Robpol86/terminaltables.git

Clone and Install

Lastly you can also just clone the repo and install from it. Usually you only need to do this if you plan on contributing to the project.

git clone https://github.com/Robpol86/terminaltables.git
cd terminaltables
python setup.py install

3、Example

>>> table_date = [
... ['name','age'],
... ['oldwang',28],
... ['laowang',30],
... ]

>>> print(table.table)
+---------+-----+
| name | age |
+---------+-----+
| oldwang | 28 |
| laowang | 30 |
+---------+-----+

 更多内容:https://robpol86.github.io/terminaltables/settings.html

posted on 2018-07-16 11:19  老王头0321  阅读(2491)  评论(0编辑  收藏  举报

导航