Get list of Toplevels on Tkinter
问题 I wanted to know if there is a simple way to get all the toplevels from a specific window, including toplevels within toplevels. In the following code I leave an example of what I want to do: from tkinter import Tk, Toplevel v = Tk() v2 = Toplevel(v) v3 = Toplevel(v2) v4 = Toplevel(v2) def toplevels(ventana): print("Here I return the list of all toplevels, in case of choosing the main window, it should return:") print() print(".") print(".toplevel") print(".toplevel.toplevel") print("