Good day,
I'm currently developing a simple Tkinter project. I have an RFID Reader that automatically prints/pastes its ID# once scanned. I have created this simple Tkinter window wherein the ID# is pasted on the Entry. My problem is that the messagebox does not appear even after the ID# is already pasted on the Entry field.
from tkinter import *
from tkinter import messagebox
root = Tk()
root.title("RFID Reader")
root.geometry("400x250")
rfid_label = Label(root, text="RFID Reader", font=("arial", 15, 'bold'), fg='red')
rfid_label.place(x=100, y=50)
rfid_entry = Entry(root, font=('arial', 15, 'bold'))
rfid_entry.focus()
rfid_entry.place(x=100, y=100)
scanned_ID = rfid_entry.get()
if len(scanned_ID) > 1:
messagebox.showinfo(title="RFID Reader", message="RFID Scan Successful.")
root.mainloop()
Please help! Thanks!