I have a issue with tkinter. I want to use Entry
to take info from the user and then
compare it to a string if the result is true I want it to print a Label
on the screen
and if false I want it to print something else. For some reason the .get
does not
show for me, and I can't find a way to compare the user input in. The Entery
to a simple
string that I saved as a variable.
from tkinter import *
window = Tk()
window.geometry("800x600")
window.title("Sara's chocolate balls")
def Button_Click():
test1 = "hey"
if entry1 == test1:
test2.pack()
else:test3.pack()
entry1 = Entry(window, width=30).pack()
Button1 = Button(window, text="Button", command=Button_Click).pack()
test2 = Label(window, text="Good")
test3 = Label(window, text="Bad")
window.mainloop()