Tkinter function variable passing

Fredrik Lundh fredrik at pythonware.com
Mon Jul 3 02:50:59 EDT 2006


arvind wrote:

> How to pass the variables defined inside the function to the another
> function on click event of the button in Tkinter?

     def the_function(master):

         variable = ...

         def callback():
             print variable

         b = Button(master, command=callback)

</F>




More information about the Python-list mailing list