正如上面你提到的可以使用这样的表格库:
from tabulate import tabulate
table=[['Alex',13,1,'Chess',10],['Zia',12,2,'Chess',25]]
headers=["Name","Age", "Number of Games","Favourite Game","Cost of Game"]
print tabulate(table, headers, tablefmt="grid")
这是你会得到什么:
+--------+-------+-------------------+------------------+----------------+
| Name | Age | Number of Games | Favourite Game | Cost of Game |
+========+=======+===================+==================+================+
| Alex | 13 | 1 | Chess | 10 |
+--------+-------+-------------------+------------------+----------------+
| Zia | 12 | 2 | Chess | 25 |
+--------+-------+-------------------+------------------+----------------+
你问的是GUI(图形)方面,或者使用什么数据结构? –
是否要在控制台中创建表? –
是在控制台中 –