使用prettytable时是否可以获得特定单元格的值?
我有以下代码来遍历一个简单表的所有行。
from prettytable import PrettyTable
table = PrettyTable(["Column 1", "Column 2", "Column 3"])
table.add_row(["A", "B", "C"])
table.add_row(["F", "O", "O"])
table.add_row(["B", "A", "R"])
for row in table:
print(row)
此示例打印以下 3 个表:
+----------+----------+----------+
| Column 1 | Column 2 | Column 3 |
+----------+----------+----------+
| A | B | C |
+----------+----------+----------+
+----------+----------+----------+
| Column 1 | Column 2 | Column 3 |
+----------+----------+----------+
| F | O | O |
+----------+----------+----------+
+----------+----------+----------+
| Column 1 | Column 2 | Column 3 |
+----------+----------+----------+
| B | A | R |
+----------+----------+----------+
怎么可能只获得或一行Column 1
的值?Column 2
Column 3