import time
from tkinter import *
from tkinter.ttk import *
window = Tk()
e = Entry(window, width=100)
e.pack()
player2 = ""
def get_text():
e.config(state='disabled')
player2 = e.get()
return player2
Button(window, text="done", command=get_text).pack()
t = 60
for x in range(t):
t = t -1
time.sleep(1)
if t == 0:
Label(window, text="Times up").pack()
e.config(state='disabled')
player2 = e.get()
Label(window, text=player2).pack()
window.mainloop()
Here is my code, but its not really working. I would like to create an entry and let user only enter words only for one minute, unless the button done is pressed then the entry value is stored in a variable called player2.