I've looked at several posts on stackOverflow that explain the answer but no matter which I use, I never can get the string from my entry widget; it just detects a string of ""
here's my code:
def buttonTest():
global score
gui.title("Test")
for child in gui.winfo_children():
child.destroy()
global questionText
global questionAnswer
questionText = StringVar()
questionAnswer = 0
question = Label(gui, textvariable = questionText, fg = "black", bg = "white")
question.grid(row = 0, column = 1)
userInput = StringVar()
input = Entry(gui, textvariable = userInput)
input.grid(row = 1, column = 0)
swapQuestion()
checkAns = Button(text = "Check answer", command = partial(checkAnswer, userInput.get(), questionAnswer), fg = "black", width=10)
checkAns.grid(row = 1, column = 2)