博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
python-AsciiTable
阅读量:7198 次
发布时间:2019-06-29

本文共 1222 字,大约阅读时间需要 4 分钟。

1、AsciiTable

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

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

  •  iter) - 表示表的列表(空或字符串列表)。
  •  str) - 在表格的上边框内显示的可选标题。
  •  bool) - 分隔列。
  •  bool) - 显示最后一行之前的边框。
  •  bool) - 在第一行之后显示边框。
  •  bool) - 在每一行之间显示一个边框。
  •  bool) - 显示上边框,左边框,右边框和下边框。
  •  dict) - 水平对齐。键是列索引(int)。值是右/左/中心。
  •  int) - 每个单元格左侧填充的空格数。
  •  int) - 每个单元格右侧填充的空格数。

2、安装

Pip Install

The easiest way to get terminaltables is to use . 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  to the project.

git clone https://github.com/Robpol86/terminaltables.gitcd terminaltablespython 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

转载于:https://www.cnblogs.com/oldwangtou/p/9316757.html

你可能感兴趣的文章
Linux下使用Firefox访问dell管理口Idrac
查看>>
jQuery 为元素添加事件
查看>>
B/S管理可以桌面化
查看>>
我的友情链接
查看>>
python-高阶函数(函数做参数)
查看>>
基于Hyper-V3.0搭建XenDesktop7之四 配置SCVMM
查看>>
从海淘到跨境电商 海外网购正呈现多样化、专业化、细分化
查看>>
SQL SERVER 2005学习心得
查看>>
龙岗客家民俗博物馆观光游
查看>>
11G Oracle RAC添加新表空间时数据文件误放置到本地文件系统的修正
查看>>
UIScrollView滚动
查看>>
项目管理
查看>>
awk
查看>>
SED
查看>>
ARP地址解析协议<一>——地址解析
查看>>
相似图片搜索的原理
查看>>
linux下安装FTP(vsftpd)
查看>>
nagios监控配置
查看>>
<c:forEach> 用法
查看>>
10分钟让你明白MySQL是如何利用索引的
查看>>