Good evening, I am struggling to return an output without creating a button in Tkinker. I want to return either "Excellent" or "Done" based on the input but only the input is showing.
Below is the code I'm struggling with
from tkinter import *
root = Tk()
num = StringVar()
entry1 = Entry(root, textvariable=num).pack()
remark = StringVar()
entry2 = Entry(root, textvariable=remark).pack()
def set_label(name, index, mode):
return remark.set(num.get())
if result > 56:
return "Excellent"
else:
return "Done"
num.trace('w', set_label)
num.set('')
root.mainloop