What is wrong here? (Attribute Error __len__)
Question: 
    import Tkinter
    
    class buttton(Tkinter.Button):
        def __init__(self,frame,action=None):
            if action==None:
                action=self.action
            Tkinter.Button.__init__(self,frame,command=action)
            self.pack(frame)
        def action(self):
            None
    
    
    root=Tkinter.Tk()
    button=buttton(root)
    root.mainloop()
    

Upon running this problem of which I am unable to find any problems with, I am
met with a rather cryptic Error...

    
    
    Traceback (most recent call last):
      File "C:/Users/19CRF01/Desktop/ab.py", line 14, in <module>
        button=buttton(root)
      File "C:/Users/19CRF01/Desktop/ab.py", line 8, in __init__
        self.pack(frame)
      File "C:\Python27\lib\lib-tk\Tkinter.py", line 1940, in pack_configure
        + self._options(cnf, kw))
      File "C:\Python27\lib\lib-tk\Tkinter.py", line 1162, in _options
        cnf = _cnfmerge(cnf)
      File "C:\Python27\lib\lib-tk\Tkinter.py", line 114, in _cnfmerge
        for c in _flatten(cnfs):
      File "C:\Python27\lib\lib-tk\Tkinter.py", line 1898, in __getattr__
        return getattr(self.tk, attr)
    AttributeError: __len__
    

I would be more than happy for any help!


Answer: Here is your problem:

    
    
    self.pack(frame)
    

`self.pack` doesn't take a frame argument. Remove `frame`, and it should run
fine, like so:

    
    
    self.pack()
    

