How do I get rid of Python Tkinter root window?

Probably the vast majority of of tk-based applications place all the components in the default root window. This is the most convenient way to do it since it already exists. Choosing to hide the default window and create your own is a perfectly fine thing to do, though it requires just a tiny bit of extra work.

To answer your specific question about how to hide it, use the withdraw method of the root window:

import Tkinter as tk
root = tk.Tk()
root.withdraw()

If you want to make the window visible again, call the deiconify (or wm_deiconify) method.

root.deiconify()

Once you are done with the dialog, you can destroy the root window along with all other tkinter widgets with the destroy method:

root.destroy()

Leave a Comment