Gunnm
Gunnm

Reputation: 994

How to eliminate curly braces in Label (text=)

How to eliminate curly braces around "There are total" and "entries in dictionary"

enter image description here

self.status_bar = Label(self.status_bar, text=("There are total", len(dictionary_data), "entries in dictionary."), bg="yellow", relief=FLAT)

Upvotes: 0

Views: 621

Answers (1)

user2555451
user2555451

Reputation:

The problem is that you are currently passing a tuple for the text parameter. Instead, you should be passing a string. You can use str.format to insert the dictionary length into this string:

self.status_bar = Label(self.status_bar, text="There are total {} entries in dictionary.".format(len(dictionary_data)), bg="yellow", relief=FLAT)

Upvotes: 4

Related Questions