I have a command menu of 'Submenu' of File menu, which was initially disabled. I want to enable the command menu if a particular condition is fulfilled during execution. Please help.
menubar=tk.Menu(hW)
filemenu=tk.Menu(menubar,tearoff=0)
filemenu.add_command(label='Open',command=FileOpen)
filemenu.add_command(label='Submenu',
command=command1,state='disabled')
menubar.add_cascade(label='File',menu=filemenu)