title: How can I change color of button when it pushed with tkinter?
body: <p>I made 100 buttons and I want to change color of button which pushed.
  How can I do that?
  Here is my code.</p>
  <pre><code>import tkinter as tk
  
  def settingships():
      column = -1
      row = 0
      root = tk.Tk()
      root.title('set ships')
      root.geometry('470x310')
      for i in range(101):
          if i &gt; 0:
              if i%10 == 1:
                  row += 1 
                  column = -1
              column += 1
              text=f'{i}'
              btn = tk.Button(root,text=text,command=collback(i)).grid(column=column,row=row)
      root.mainloop()
  
  
  def collback(i):
      def nothing():
          btn.config(bg='#008000')
  
      return nothing
  </code></pre>