def tk_print(root, name=True, class_= True, indent="\t"):
    """Print a tree of widget names and/or classes"""
    print(root)
    
    if name or class_:
        _print_widget_tree_from(root, name, class_, 1, indent)
Print a tree of widget names and/or classes
recipes/Python/580738_Tkinter_selectors/recipe-580738.py