passing arguments from scale widget to function

m7b52000 tpearce at internode.on.net
Mon Aug 22 08:51:03 EDT 2005


Matt Hammond wrote:
>> Ahhhh. Partial success with : command = Calc. A slider will now pass 
>> its  argument to a function without problem. My Calc function however 
>> is  expecting 3 arguments - 1 from each slider i.e moving any of the 
>> 3  sliders should cause a recalculation. I am now getting the 
>> following  error:
>> TypeError: Calc() takes exactly 3 arguments (1 given)
> 
> 
> I'm sure you can figure this out now! Either:
>   use lambda functions, as described, to call Calc with the correct  
> arguments
> or:
>   write three functions (one for each slider) that call Calc with all 3
>   arguments it requires
> 
> regards
> 
> 
> 
> Matt
  Have already started on the 2nd aproach. I might become a programmer 
yet...............



More information about the Python-list mailing list