如何消除周围的花括号"总共"和"字典中的条目"
self.status_bar = Label(self.status_bar, text=("There are total", len(dictionary_data), "entries in dictionary."), bg="yellow", relief=FLAT)
答案 0 :(得分:4)
问题是您当前正在传递text
参数的元组。相反,你应该传递一个字符串。您可以使用str.format
将字典长度插入此字符串中:
self.status_bar = Label(self.status_bar, text="There are total {} entries in dictionary.".format(len(dictionary_data)), bg="yellow", relief=FLAT)