Why does it keep saying denied when I write "password" in the text box. I assume it has to do with the "content=" line, but for the life of me I have no idea what it should be.
from tkinter import * class Application(Frame): def __init__(self, master): Frame.__init__(self, master) self.grid() self.create_widgets() def create_widgets(self): self.instruction = Label(self, text = "Enter PW") self.instruction.grid(row = 0, column=0, columnspan = 3, sticky = W) self.text = Text(self, width = 35, height =5, wrap = WORD) self.text.grid(row =1, column=1, sticky = W) self.submit_button = Button(self, text = "Submit", command = self.reveal) self.submit_button.grid(row = 2, column = 0, sticky =W) self.text1 = Text(self, width = 35, height =5, wrap = WORD) self.text1.grid(row = 3, column =0, columnspan = 2, sticky=W) def reveal (self): content = self.text.get("2.0", END) if content == "password": message = "congrats" else: message = "denied" self.text1.insert(0.0, message) root = Tk() root.title("password") root.geometry("250x250") app = Application(root) root.mainloop()