this script just adds hello' button to the right side of parent-- container frame in factthe button on the right in this window represents an embedded componentits button really represents an attached python class object pressing the embedded class' button on the right prints message as beforepressing the new button exits the gui by sys exit callc:\pp \gui\intropython gui py hello frame world hello frame world hello frame world hello frame world in more complex guiswe might instead attach large frame subclasses to other container components and develop each independently for instanceexample - is yet another specialized frame itselfbut it attaches an instance of the original hello class in more object-oriented fashion when run as top-level programit creates window identical to the one shown in figure - example - pp \gui\intro\gui py from tkinter import from gui import hello get tk widget classes get the subframe class class hellocontainer(frame)def __init__(selfparent=none)frame __init__(selfparentself pack(self makewidgets(def makewidgets(self)hello(selfpack(side=rightattach hello to me button(selftext='attach'command=self quitpack(side=leftif __name__ ='__main__'hellocontainer(mainloop(this looks and works exactly like gui but registers the added button' callback handler as self quitwhich is just the standard quit widget method this class inherits from frame the window this time represents two python classes at work--the embedded component' widgets on the right (the original hello buttonand the container' widgets on the left naturallythis is simple example (we attached only single button hereafter allbut in more practical user interfacesthe set of widget class objects attached in this way graphical user interfaces