I understand lambda functions quite well. Having said that, I have a Python tkinter GUI that opens a separate 'options' window - user enters text, then can click the "set" button, or press enter which is bound to the same button, to set the text and return to the main window.
It seems that the binding code for the enter key needs me to tell the lambda function I'm passing input (as I understand that's how they work and that's what I expect).
However - the 'command=' code for the button only works if I don't include it, which I don't understand.
Here is the code - my question is - how come in the button case I don't tell the lambda function I'm passing a variable into the function, but in the enter-key binding I do?
saveBtn = tk.Button(saveWindow,text='Save', width=10,**command=lambda: pressed(fName)**)
saveBtn.grid(row=2,column=2)
saveWindow.bind('<Return>',**lambda x: pressed(fName)**)