broken dropdown menu code
Question: I was following <https://www.youtube.com/watch?v=PSm-tq5M-Dc> a tutorial for
doing a drop-down menu in a gui. In the video the code works but i can't get
mine too, I think it may have something to do with different python versions.

    
    
    from tkinter import * 
    
    def doNothing():
        print ("ok ok i won't...")
    
    root = Tk()
    
    menu = Menu(root)
    roo.config(menu=menu)
    
    subMenu = Menu(menu)
    menu.add_cascade(label="File", menu=subMenu)
    subMenu.add_command(label="New Project..."), comand=doNothing
    subMenu.add_command(label="New"), comand=doNothing
    subMenu.add_separator()
    subMenu.add_command(label="Exit", command=doNothing)
    
    editMenu = Menu(menu)
    menu.add_cascade(label="Edit", menu=editMenu)
    editMenu.add_command(label="Redo", comand=doNothing)
    
    root.mainloop()
    

This is the error

    
    
    C:\Users\TheSheep\Desktop\pygui>python dropdown.py
      File "dropdown.py", line 14
        subMenu.add_command(label="New Project..."), comand=doNothing
        ^
    SyntaxError: can't assign to function call
    


Answer: You have few "typos"

  * it has to be `root` instead `roo` in `roo.config()`

  * `)` has to be at the end of line in both
    
        subMenu.add_command(label="New Project..."), comand=doNothing #
    subMenu.add_command(label="New"), comand=doNothing
    

  * it has to be `command=` instead of `comand=` (see: `mm`) 

.

    
    
    from tkinter import * 
    
    def doNothing():
        print ("ok ok i won't...")
    
    root = Tk()
    
    menu = Menu(root)
    root.config(menu=menu)
    
    subMenu = Menu(menu)
    menu.add_cascade(label="File", menu=subMenu)
    
    subMenu.add_command(label="New Project...", command=doNothing)
    subMenu.add_command(label="New", command=doNothing)
    subMenu.add_separator()
    subMenu.add_command(label="Exit", command=doNothing)
    
    editMenu = Menu(menu)
    menu.add_cascade(label="Edit", menu=editMenu)
    editMenu.add_command(label="Redo", command=doNothing)
    
    root.mainloop()
    

