example - builds the window in figure - example - pp \gui\intro\gui py from tkinter import class hellobutton(button)def __init__(selfparent=none**config)button __init__(selfparent**configself pack(self config(command=self callbackdef callback(self)print('goodbye world 'self quit(add callback method and pack myself could config style too default press action replace in subclasses if __name__ ='__main__'hellobutton(text='hello subclass world'mainloop(figure - button subclass in action this example isn' anything special to look atit just displays single button thatwhen pressedprints message and exits but this timeit is button widget we created on our own the hellobutton class inherits everything from the tkinter button classbut adds callback method and constructor logic to set the command option to self callbacka bound method of the instance when the button is pressed this timethe new widget class' callback methodnot simple functionis invoked the **config argument here is assigned unmatched keyword arguments in dictionaryso they can be passed along to the button constructor the **config in the button constructor call unpacks the dictionary back into keyword arguments (it' actually optional herebecause of the old-style dictionary widget call form we met earlierbut doesn' hurtwe met the config widget method called in hellobutton' constructor earlierit is just an alternative way to pass configuration options after the fact (instead of passing constructor argumentsstandardizing behavior and appearance so what' the point of subclassing widgets like thisin shortit allows sets of widgets made from the customized classes to look and act the same when coded wellwe get both "for freefrom python' oop model this can be powerful technique in larger programs customizing widgets with classes