Ok so I have been trying to get user input from an entry with Tkinter and store it into a variable that is printed at the end of the program, but when the variable is printed, the output is the initial value.
The code:
from tkinter import *
hello = ''
root = Tk()
e = Entry(root, width = 50)
e.pack()
def myClick():
hello = e.get()
button1 = Button(root, text = 'ik', command = myClick)
button1.pack()
root.mainloop()
print(hello)