widget label(roottext=textrelief=ridgewidget pack(side=sideexpand=yesfill=bothif extraswidget config(**extrasreturn widget default config pack automatically apply any extras def button(rootsidetextcommand**extras)widget button(roottext=textcommand=commandwidget pack(side=sideexpand=yesfill=bothif extraswidget config(**extrasreturn widget def entry(rootsidelinkvar**extras)widget entry(rootrelief=sunkentextvariable=linkvarwidget pack(side=sideexpand=yesfill=bothif extraswidget config(**extrasreturn widget if __name__ ='__main__'app tk(frm frame(apptopmuch less code required herelabel(frmleft'spam'button(frmbottom'press'lambdaprint('pushed')mainloop(this module makes some assumptions about its clientsuse caseswhich allows it to automate typical construction chores such as packing the net effect is to reduce the amount of code required of its importers when run as scriptexample - creates simple window with ridged label on the left and button on the right that prints message when pressedboth of which expand along with the window run this on your own for lookits window isn' really anything new for usand its code is meant more as library than script--as we'll see when we make use of it later in ' pycalc this function-based approach can cut down on the amount of code required as functionsthoughits tools don' lend themselves to customization in the broader oop sense moreoverbecause they are not methodsthey do not have access to the state of an object representing the gui mixin utility classes alternativelywe can implement common methods in class and inherit them everywhere they are needed such classes are commonly called mixin classes because their methods are "mixed inwith other classes mixins serve to package generally useful tools as methods the concept is almost like importing modulebut mixin classes can access the subject instanceselfto utilize both per-instance state and inherited methods the script in example - shows how guimixincommon tool mixin classes