helloi must be going :\pp \gui\intronormallysuch messages would be displayed in the guibut we haven' gotten far enough to know how just yet callback functions usually do moreof course (and may even pop up new independent windows altogether)but this example illustrates the basics in generalcallback handlers can be any callable objectfunctionsanonymous functions generated with lambda expressionsbound methods of class or type instancesor class instances that inherit __call__ operator overload method for button press callbackscallback handlers always receive no arguments (other than an automatic selffor bound methods)any state information required by the callback handler must be provided in other ways--as global variablesclass instance attributesextra arguments provided by an indirection layerand so on to make this bit more concretelet' take quick look at some other ways to code the callback handler in this example lambda callback handlers recall that the python lambda expression generates newunnamed function object when run if we need extra data passed in to the handler functionwe can register lambda expressions to defer the call to the real handler functionand specify the extra data it needs later in this part of the bookwe'll see how this can be more usefulbut to illustrate the basic ideaexample - shows what example - looks like when recoded to use lambda instead of def example - pp \gui\intro\gui py import sys from tkinter import lambda generates function widget button(nonebut contains just an expression text='hello event world'command=(lambdaprint('hello lambda world'or sys exit()widget pack(widget mainloop(this code is bit tricky because lambdas can contain only an expressionto emulate the original scriptthis version uses an or operator to force two expressions to be run print works as the firstbecause it' function call in python --we don' need to resort to using sys stdout directlyadding user-defined callback handlers