window.quit() #Closes the GUI window which then leads to the rest of the program being able to end as mainloop() terminates
#The GUI will only close if the program is run normally such as from the terminal and not if it is run in the python shell due to how tkinter's quit function works