On python tkinter
I have the following code for creating a Menu
with only 2 menu items:
my_menu = Menu(root, tearoff=False)
my_menu.add_command(label="Show details", command=whatever)
my_menu.add_command(label="Delete me", command=something)
Now I want to add an if
statement to check if the menu item: Delete me exists in menu or not. If exists, delete that menu item (like the following code snippet, just for demonstration)
if... : #if statement to check if menu item "Delete me" exists
my_menu.delete("Delete me") #delete the menu item
else:
pass