Stubbing function

Timothy Grant tjg at avalongroup.net
Fri Jan 14 19:52:10 EST 2000


Charles G Waldman wrote:
 
> Note that
> 
>      lambda: None
> 
>  works just fine.
> 
> lambdas may not contain any statements, just functions and
> expressions.  For instance:
> 
>      lambda x: print x
> 
> is illegal, wheras
> 
>      lambda x: sys.stdout.write("%s\n"%x)
> 
> is allowed.
> 
> Hope this helps,

The above was the missing piece of the puzzle for me thank you much. Now
another question: 

Those same "command=self.function" buttons do something I don't
understand:

I have a button whose command argument reads "command=self.Add" This
works as I would expect. But, if I want to pass arguments to the
function as in "command=self.Add(a,b,c)"

I see the following behaviour: The script executes the function when it
is run, NOT when the button is pushed, and actually pushing the button
does nothing.

How does one pass arguments to a callback function?

Thanks.

-- 
Stand Fast,
    tjg.

Chief Technology Officer              tjg at exceptionalminds.com
Red Hat Certified Engineer            www.exceptionalminds.com
Avalon Technology Group, Inc.                   (503) 246-3630
>>>>>>>>>>>>EXCEPTIONAL MINDS, INNOVATIVE PRODUCTS<<<<<<<<<<<<




More information about the Python-list mailing list