How to Solve NameError: name 'mainloop' is not defined -- tkinter
Solution: Import the 'mainloop' module
To Solve the error, add the following line to the top of your code.
from tkinter import mainloop
For more information:
Python tkinter mainloop