title: How to create clear function in python/tkinter?
body: <p>I am having trouble in clearing the text displayed after pressing Hello button. When the clear button is pressed it is supposed to clear the displayed text. Can anyone help me? The code is shown below. You can copy paste the code to run, only the clear button is not working.</p>
  
  <pre><code>from tkinter import*
  from tkinter import ttk
  
  
  
  class Test:
  
      def button_press(self, value):
          entry_val = self.number_entry.get()
          entry_val += value
          self.number_entry.delete(0, 'end')
          self.number_entry.insert(0, entry_val)
  
  #def button_clear(self):
      #?????
  
      def __init__(self, root):
          self.entry_value = StringVar(root, value="")
          root.title("Test")
          root.geometry('200x200')
          root.resizable(width=False, height=False)
          style = ttk.Style()
          style.configure('TButton', font='arial', padding=5)
          style.configure('TEntry', font='arial', padding=20)
  
          self.number_entry = ttk.Entry(root, textvariable = self.entry_value,    width=70)
          self.number_entry.grid(row=0, columnspan=4)
  
          self.button1 = ttk.Button(root, text='Hello', command=lambda:  self.button_press('Hello')).grid(row=3, column=0)
  
          self.button_clear = ttk.Button(root, text='clear', command=lambda: self.button_clear()).grid(row=4, column=0)
  
  
  
  root = Tk()
  calc = Test(root)
  root.mainloop()
  </code></pre>