When you call mainloop in tkinter, do you need to call it in the first window that will be opened?

166 views Asked by At

I'm making a login system, and I called mainloop in the first window that will be opened upon starting the program. This window is the window which asks whether the user would like to login or register. Obviously, this means I can't close this window at all, which is impractical and I was hoping to be able to use mainloop instead in the main window that will open once the user has logged in, which will be a window where they will be able to play my game. Will this cause any issues in the program, or will everything run as usual?

1

There are 1 answers

2
Raunak Singh On

call the mainloop for every window you make for example if you make a window as root=Tk() then after writing all the code for the window write root.mainloop() in the end