self calc text set(self calc eval runstring('pi')if __name__ ='__main__'root tk(button(roottop'quit'root quitcalcguiplus(**getcalcargs()mainloop(-bg,-fg to calcgui because pycalc is coded as python classyou can always achieve similar effect by extending pycalc in new subclass instead of embedding itas shown in example - example - pp \lang\calculator\calculator_plus_ext py ""############################################################################ customization with an extra row of buttons for common operationsa more useful customizationadds buttons for more operations (sqrt /xetc by subclassing to extend the original classnot embeddingnew buttons show up before frame attached to bottom by calcgui class############################################################################""from tkinter import from calculator import calcguigetcalcargs from pp gui tools widgets import labelframebutton class calcguiplus(calcgui)def makewidgets(self*args)label(selftop'pycalc plus subclass'calcgui makewidgets(self*argsfrm frame(selfbottomextras [('sqrt''sqrt(% )')(' ^ ''(% )** ')(' ^ ''(% )** ')(' / '' /(% )')for (labexprin extrasbutton(frmleftlab(lambda expr=exprself onextra(expr))button(frmleftpi 'self onpidef onextra(selfexpr)tryself text set(self eval runstring(expr self text get())exceptself text set('error'def onpi(self)self text set(self eval runstring('pi')if __name__ ='__main__'calcguiplus(**getcalcargs()mainloop(passes -bg-fg on notice that these buttonscallbacks force floating-point division to be used for inverses just because that' how operates in python (/for integers truncates remainders text and language