我想用值来格式化一个标题,但我不能。
from prettytable import PrettyTable
name = "table 1"
table = PrettyTable()
owntitle = "table name is {}".format(str(name))
table.title = owntitle
table.field_names = ['Experiment', 'Value']
table.add_row(['bla', 3.14])
table.add_row(['baz', 42.0])
print(table)
有什么建议吗?