title: Python tkinter: changing color for a recently clicked button
body: <p>I'm trying to have a program which would have a grid of 8x8 buttons which would on-click change their color
  My code looks like this:</p>
  
  <pre><code>def Function(self):
      for i in range(8):
          for j in range(8):
              a=Button(self,width=2,height=1,command=lambda widget="button"+str(i)+str(j):Click1(self,widget))
              a.grid(row=i,column=j)
  
  def Click1(self):
      a["bg"]="blue"
  </code></pre>
  
  <p>The problem I have with this is that I keep getting an error saying:</p>
  
  <pre><code>NameError: name 'Click1' is not defined
  </code></pre>
  
  <p>any solutions for this?</p>