【发布时间】:2022-01-02 16:37:58
【问题描述】:
我正在尝试使用文档制作一个基本表格。 这是我的代码版本:
from prettytable import *
table = PrettyTable
table.add_column("", "Pokemon Name", ["Pikachu", "Squirtle", "Charmander"])
table.add_column("", "Type", ["Electric Type", "Water Type", "Fire Type"])
print(table)
我已尝试删除并重新安装 Prettytable,但问题仍然存在。
if len(self._rows) in (0, len(column)):
AttributeError: 'str' object has no attribute '_rows'
我还能做些什么来解决这个问题吗?
【问题讨论】: