2 Star 2 Fork 0

Leviathan / Pylsy

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.md 1.17 KB
一键复制 编辑 原始数据 按行查看 历史
leviathan1995 提交于 2015-09-02 05:32 . update

Pylsy

Build Status

Pylsy is a simple Python library for drawing tables in the terminal/console. Just two lines of code!

image

Install

pip install pylsy

Sample Usage

At the very first start, pylsy needs to be imported
from pylsy import PylsyTable
First, you need to create a list, which will contain the table attributes
attributes=["name","age","sex","id","time"]
In the second step, you need to use PylsyTable to create the ASCII table
table=PylsyTable(attributes)
Then, you need to populate the values for each attribute and add the values to the table. Populating the values for the attribute "name" is shown below
name=["sun","lsy","luna","leviathan"]
Then, add the values to the table
table.add_data("name",name)
After populating each attribute and adding the values to the table, you can create the ASCII table
table.create_table()

License

MIT
Python
1
https://gitee.com/Leviathan1995/Pylsy.git
git@gitee.com:Leviathan1995/Pylsy.git
Leviathan1995
Pylsy
Pylsy
master

搜索帮助