python - What exactly is the difference between 'Lambda formats'? -


First of all, I'm a beggar in Python, so get ready for a sweet question)) < P> In one of the topics of this site, I have received very useful advice regarding the use of the Lambda function.

Before correcting this, my code is:

  Def entree1 (self): #Functions that have to be configured in itself. Anyone who has the label (Text = "X") labeled 'X' Fane = TE (Poll) 1 = Label (Fan, Text = '  

After correcting it, my code (_ & Lt;; _ | ') ("& lt; button-1", lambda: entry 1 (poll1)) #

  def entree1 (self) : #Functions that have to be configured in itself.Configured (text = "X") label blocks, whatever is 'X' Fan = Tk () poll 1 = label (fen, text = '| _ |') Poll 1 .bind ("& lt; Button-1", Lambda x: Entry 1 (Poll 1)) #event Handler   lambda: some funny   lambda x: some fun .  

And it worked, which is great, However, I can not understand the difference between these two forms. x

Thank you for your time! Please

To define me, you can translate the lambda expression that you most likely use:

  lambda: entree1 ( Pole 1)    
  def lambdaFunc (): Global poll 1 return entree1 (poll 1)   

is your correct function

  Lambda x: Entry 1 (Poll 1)   

Which is similar to

  DIF LambdaFunk (X) : Global Poll 1 Return Entry 1 Pole1)   

You need additional logic because the RAT buttons call those functions that they can be a variable (I forget what the variable is, right ), So the input variable to the function when any error Ties do not take reason.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -