Refresh tkinter GUI after scanning three barcodes and compare strings

Hello everyone I am new to python and very new to GUI tkinter. I am working on a project for work that is a simple task, but I wanted to try to make it work using a GUI. The task is to scan three barcodes, parse the last nine digits of the barcodes and compare. If they all match then display pass. If they don't display fail. I have written the code using the basic command line and I was able to get everything to work. Now trying to implement that code with a graphical user interface is where I am struggling. The issue I am running into is knowing how or what to update/refresh. My logic works as long as I have a string entered in the ENTRY text box before the code is executed. If the strings are different it fails if they are the same or empty it passes. I wanted to be able to scan three serial numbers and have the bottom frame update pass or fail and then scan a different set of serial numbers and get another result. See my code below... Any help will be greatly appreciated. Thanks everyone!

"""

from tkinter import *


# FUNCTION THAT ALLOWS THE CURSOR TO MOVE TO THE NEXT ENTRY TEXT BOX AUTOMATICALLY.
def go_to_next_entry(event, entry_list, this_index):
next_index = (this_index + 1) % len(entry_list)
entry_list[next_index].focus_set()


# FUNCTION THAT DETERMINES IF THE THREE SERIAL NUMBERS ARE THE SAME OR DIFFERENT.
# DISPLAYS PASS OR FAIL BASED ON RESULT OF CONDITION.
def get_results():

# DECLARING AND INITIALISING VARIABLES THAT ARE EQUAL TO INPUT FROM ENTRY TEXT BOXES.
scan_one = scan_one_entry.get()
scan_two = scan_two_entry.get()
scan_three = scan_three_entry.get()

# PARSING THE LAST NINE DIGITS OF THE ENTERED STRING.
parsed_scan_one = scan_one[-9:]
parsed_scan_two = scan_two[-9:]
parsed_scan_three = scan_three[-9:]

# IF-ELSE CONDITION THAT DISPLAYS PASS IF THREE SERIAL NUMBERS ARE THE SAME AND FAIL IF THEY 
ARE NOT THE SAME.
if parsed_scan_one == parsed_scan_two and parsed_scan_two == parsed_scan_three and 
parsed_scan_three == parsed_scan_one:

    # DELETING DATA THAT IS STORED IN ENTRY TEXT BOXES.
    scan_one_entry.delete(0, END)
    scan_two_entry.delete(0, END)
    scan_three_entry.delete(0, END)

    # PLACING THE PASS BOTTOM FRAME IF CONDITION IS MET.
    pass_bottom_frame.grid(row=1, sticky="ns, ew")

    # CREATING PASS BOTTOM FRAME WIDGETS OF IF CONDITION IS MET.
    pass_label = Label(pass_bottom_frame,
                       text='PASSED SCAN CHECK!',
                       font=('Helvetica', 100),
                       justify="center")

    # PICKING BACKGROUND COLOR AND FONT COLOR OF LABEL WIDGET
    pass_label.config(bg="#63d464", fg="#000000")

    # PLACING THE PASS BOTTOM FRAME WIDGET IF CONDITION IS MET
    pass_label.place(relx=.5, rely=.5, anchor="center")

else:

    # DELETING DATA THAT IS STORED IN ENTRY TEXT BOXES.
    scan_one_entry.delete(0, END)
    scan_two_entry.delete(0, END)
    scan_three_entry.delete(0, END)

    # PLACING THE FAILED BOTTOM FRAME.
    fail_bottom_frame.grid(row=1, sticky="ns, ew")

    # CREATING PASS BOTTOM FRAME WIDGETS.
    fail_label = Label(fail_bottom_frame,
                       text='FAILED SCAN CHECK!',
                       font=('Helvetica', 100),
                       justify="center")

    # PICKING BACKGROUND COLOR AND FONT COLOR OF LABEL WIDGET.
    fail_label.config(bg="#f51023", fg="#000000")

    # PLACING THE FAILED BOTTOM FRAME WIDGET.
    fail_label.place(relx=.5, rely=.5, anchor="center")

# CREATING MAIN WINDOW
main_window = Tk()
main_window.title('Serial Number Barcode Scan Check')
main_window.state("zoomed")

# CREATING THE MAIN FRAMES THAT WILL BE PLACED IN MAIN WINDOW
top_frame = Frame(main_window, width=1800, height=500)
pass_bottom_frame = Frame(main_window, bg="#63d464",  width=1800, height=500)
fail_bottom_frame = Frame(main_window, bg="#f51023",  width=1800, height=500)

# LAYOUT MAIN TOP FRAME
main_window.grid_rowconfigure(1, weight=1)
main_window .grid_columnconfigure(0, weight=1)

# PLACING TOP FRAME
top_frame.grid(row=0, sticky="ns, ew")

# CREATING TOP FRAME WIDGETS
# TOP THREE ARE LABELS AND THE LAST THREE ARE ENTRY BOXES
scan_one_label = Label(top_frame,
                       text='ENTER SCAN ONE: ',
                       font=('Helvetica', 40))
scan_two_label = Label(top_frame,
                       text='ENTER SCAN TWO: ',
                       font=('Helvetica', 40))
scan_three_label = Label(top_frame,
                         text='ENTER SCAN THREE: ',
                         font=('Helvetica', 40))
scan_one_entry = Entry(top_frame, font="Helvetica 20", justify="center", border=5)
scan_two_entry = Entry(top_frame, font="Helvetica 20", justify="center", border=5)
scan_three_entry = Entry(top_frame, font="Helvetica 20", justify="center", border=5)

# PLACING THE TOP FRAME WIDGETS INTO THE TOP FRAME
scan_one_label.grid(row=0, column=0, sticky='w')
scan_two_label.grid(row=1, column=0, sticky='w')
scan_three_label.grid(row=2, column=0, sticky='w')
scan_one_entry.grid(row=0, column=1, ipadx=100, ipady=8)
scan_two_entry.grid(row=1, column=1, ipadx=100, ipady=8)
scan_three_entry.grid(row=2, column=1, ipadx=100, ipady=8)

# CODE USED TO MOVE TO EACH ENTRY TEXT BOX AUTOMATICALLY
entries = [child for child in top_frame.winfo_children() if isinstance(child, Entry)]
for index, entry in enumerate(entries):
    entry.bind('<Return>', lambda e, index=index: go_to_next_entry(e, entries, index))

# CALLING THE FUNCTION GET RESULTS
get_results()

# MAIN LOOP
main_window.mainloop()

"""

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum