'Tkinter label text is a funtion object instead of text
I've been googling around for over an hour at this point, but I can't figure this out. I want to display the result of the function as the label's text. The problem is that even though the return of the function is for example: 250.2, when I place the label into the tkinter window, it looks more like (numbers)< lambda >, which I think is a function object.
The label:
self.temperature = ttk.Label(
self,
text=lambda:self.displayInfo(0))
The function:
def displayInfo(self, index):
self.infoList = WeatherInfo.jsonToString(self)
return self.infoList[index]
Thanks in advance.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
