python各种方式打印表格

2022-07-04  本文已影响0人  _宋江_

https://stackoverflow.com/questions/9535954/printing-lists-as-tabular-data

prettytable可以使用属性:

table.SetRowLine(border)

table.SetRowSeparator("-")

https://pkg.go.dev/github.com/olekukonko/tablewriter@v0.0.0-20170122224234-a0225b3f23b5#section-readme

Example 4 - Custom Separator

table, _ := tablewriter.NewCSV(os.Stdout, "test.csv", true)

table.SetRowLine(true)        // Enable row line

// Change table lines

table.SetCenterSeparator("*")

table.SetColumnSeparator("‡")

table.SetRowSeparator("-")

table.SetAlignment(tablewriter.ALIGN_LEFT)

table.Render()

上一篇下一篇

猜你喜欢

热点阅读