[Tutor] Tkinter's Label

Alan Gauld alan.gauld at btinternet.com
Thu Feb 17 00:47:09 CET 2011


"Emeka" <emekamicro at gmail.com> wrote

> Is the below the standard way of checking the content of Label in 
> "if"
> statement?
>
> root = Tk()
> label = Label(root , text = "pure")
>
> if label["pure"] == "pure":

Almost, but the index should be 'text':

if label["text"] == "pure":

HTH,


-- 
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list