我打印了这张表。我只能对安装了 PTable 的第一个字符串执行此操作。
def table_example():
"""It is needed to install PTable to have title line"""
table = PrettyTable()
table.title = 'Results for method'
table.field_names = ['EWRWE', 'WERWER']
table.add_row(['qwer', 3.14])
table.add_row(['ewr', 42.0])
print(table)
+--------------------+
| Results for method |
+---------+----------+
| EWRWE | WERWER |
+---------+----------+
| qwer | 3.14 |
| ewr | 42.0 |
+---------+----------+
我也需要擦除第二个字符串的垂直线。如何在任何 python 库中这样做?