How to resolve "_tkinter.TclError: unknown option"?
Question: I am learning python tkinter but I have an error whenever I tried to compile
it:

    
    
    Traceback (most recent call last):
    File "<stdin>", line 1, in <module>
    File "/usr/lib/python2.7/dist-packages/spyderlib/ 
    widgets/externalshell/sitecustomize.py", line 540, in runfile 
    execfile(filename, namespace)
    File "/home/jason/.spyder2/.temp.py", line 14, in <module>
    menu.config(menu=menu)
    File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1274, 
    inconfigure
    return self._configure('configure', cnf, kw)
    File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1265, 
    in _configure
    self.tk.call(_flatten((self._w, cmd)) + self._options(cnf))
    _tkinter.TclError: unknown option "-menu").
    

My code is:

    
    
    from tkinter import *
    
    def hello():
        print "hello"    
    
    root = Tk()
    menu = Menu(root)
    menu.config(menu=menu)
    menu.add_command(label ="new",command = hello)
    
    root.mainloop()
    


Answer: You have an issue with your code a little bit. Instead of `menu.config`, use
`root.config`, you will not get any such errors.

For more information and detailed tutorial, kindly visit [Tkinter Menu
Widget](http://effbot.org/tkinterbook/menu.htm).

