+ 5
Is this correct to check if background color is 'lightskyblue' in python tkinter?
if(self.slider2.config.bg=='lightskyblue'):
3 ответов
+ 2
Try like this:
if(self.slider2.config()['background'][4]=='lightskyblue'):
+ 3
@Tibor Santa, why [4]?
+ 1
config() without arguments, returns a dictionary of all attributes. Each dictionary value is a tuple... I tested and figured the value is the 5th element of this tuple, hence [4]