#bring tkinter window to the foreground add this to the end of your code root.lift()
root.attributes("-topmost", True)