O'Reilly logo
  • You Wang thinks this is interesting:

The answer is that the button click event is a callback function, and by the time the button is clicked by a user, the variables referenced in this function are known and do exist.


Cover of Python GUI Programming Cookbook


bind enter key to func: action.bind('<Return>', lambda x: clickMe())