I'm writing a basic number guessing game, and I'm trying to put the program into a window. Everything works fine except when I try to access the variable created in my entry_box
and then compare it to an int
.
Right now, the variable coming out of the entry_box
is a StringVar
. How do I convert this to an integer so I can compare the variables?
# Creates the entry box and variable that will be used in it
# answer = StringVar()
entry_box = Entry(window, textvariable = answer, width = 25, bg = 'white') .place(x = 350, y = 0)
num1 = answer.get()
So right now answer is a StringVar, and im trying to convert it to an Integer. Any help would be appreciated.