title: How to update Label widget each time Button is clicked using TkInter - Python
body: <p>So I am trying to build a simple <strong>calculator</strong> that displays the number pi i.e., 3.14 in Label and each time the button 'click me' is clicked <strong>it adds a another decimal  value to the 3.14.</strong> For example, once clicked the Label would display 3.141, second time: 3.1415 etc etc. </p>
  
  <p>Here is the code:</p>
  
  <pre><code># Import the Tkinter functions
  from Tkinter import *
  
  
  # Create a window
  loan_window = Tk()
  
  loan_window.geometry('{}x{}'.format(500, 100))
  
  # Give the window a title
  loan_window.title('Screeen!')
  
  ## create the counter
  pi_num = 3.14
  
  # NUMBER frame
  frame = Frame(loan_window, width=100, height=50)
  frame.pack()
  
  def addPlaceValue():
  
      pi_num= 3.14
      return pi_num
  
  
  ## create a label and add it onto the frame
  display_nums = Label(frame, text = 'pi_num')
  display_nums.pack()
  
  
  #### create a label and add it onto the frame
  ##display_nums = Label(frame, text = pi_num)
  ##display_nums.pack()
  ##
  
  # Create a button which starts the calculation when pressed
  b1 = Button(loan_window, text = 'Click me', command= addPlaceValue, takefocus = False)
  b1.pack()
  
  
  
  # Bind it 
  loan_window.bind('&lt;Return&gt;', addPlaceValue())
  
  
  # event loop
  loan_window.mainloop()
  </code></pre>
  
  <p>I've tried many times to keep track of the button clicks, but failed to do so. I see one issue; the code doesn't know which n-th time a button is clicked. Any ideas?</p>