python - TypeError: <lambda>() takes no arguments (1 given) -


i newbie python programming , still trying figure out use of lambda. worrking on gui program after googling figured need use buttons work need to

this works

mtrf = button(root, text = "off",state=disabled,command = lambda:b_clicked("mtrf")) 

but when same scale does not work

leds = scale(root,from_=0,to=255, orient=horizontal,state=disabled,variable =num,command =lambda:scale_changed('led')) 

scale calls function passed command 1 argument, have use (although throw away immediately).

change:

command=lambda: scale_changed('led') 

to

command=lambda x: scale_changed('led') 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -