Click here to display price', command=self.show_option).pack()
        self.text = tk.Text(self)
        self.text.pack(pady = 10)
        self.text.config(state='disabled')
        restart_button = tk.Button(self, text="Restart",
              command=self.restart)
        restart_button.pack()
        refresh_button = tk.Button(self, text="Refresh", command=self.refresh).pack() 
        refresh_button.pack()  

    def onValidate(self,S):
    if S in ['0','1','2', '3', '4', '5', '6', '7', '8', '9']: 
        return True
    else:
        self.bell() # adds a sound effect to error
        self.text.delete(1.0, tk.END) # deletes the error message if valid entry provided
        self.text.insert(tk.END, "Invalid entry.  Please try again.") # displays an error message if a number not provided in entry widget
        return False

    def restart(self):
        self.refresh()
        show_frame("StartPage")

    def refresh(self):
        self.text.config(state='normal')
        self.weight_entry.delete(0,tk.END)
        self.text.delete("1.0", "end")

Advice on both elements would be appreciated.

A:

The first step is to have your button call a proper function rather than using lambda. Unless you understand why and when to use lambda, it usually just makes the code harder to write and understand.
Once you have it call a function, you can use the function to clear the entries.
Example:
class PLG(tk.Frame):
    def __init__(self, parent, controller):
       ...
        tk.Button(self, text="Restart", command=self.restart)
        tk.Button(self, text="Refresh", command=self.refresh)
       ...

    def restart(self):
        self.refresh()
        self.controller.show_frame("StartPage")

    def refresh(self):
        self.weight_entry.
Click here to display price', command = self.show_option).pack () 
         self.text = tk. Text(self) 
         self.text.pack(pady = 10) 
         self.text.config(state='disabled') 
         restart_button = tk. Button(self, text="Restart ", 
               instruction = self.restart) 
         restart_button.pack () 
         refresh_button = tk. Button(self, text="Refresh ", instruction = self.refresh).pack () 
         refresh_button.pack ()  

     def onValidate(self, S ): 
     if S in [' 0','1','2',' 3',' 4',' 5',' 6',' 7',' 8',' 9' ]: 
         reelect True 
     else: 
         self.bell () # lend a good effect to error 
         self.text.delete(1.0, tk. END) # delete the error message if valid entry supply 
         self.text.insert(tk. END, " Invalid entry.   Please try again. ") # display an error message if a number not provide in entrance widget 
         return False 

     def restart(self ): 
         self.refresh () 
         show_frame("StartPage ") 

     def refresh(self ): 
         self.text.config(state='normal') 
         self.weight_entry.delete(0,tk. END) 
         self.text.delete("1.0 ", " end ") 

 Advice on both elements would be appreciated. 

 A: 

 The inaugural step is to have your button address a proper function rather than using lambda. Unless you understand why and when to practice lambda, it usually precisely makes the code harder to write and sympathize. 
 Once you have it call a function, you can use the function to clear the entries. 
 Example: 
 class PLG(tk. Frame ): 
     def _ _ init__(self, parent, controller ): 
       ... 
         tk. Button(self, text="Restart ", command = self.restart) 
         tk. Button(self, text="Refresh ", command = self.refresh) 
       ... 

     def restart(self ): 
         self.refresh () 
         self.controller.show_frame("StartPage ") 

     def refresh(self ): 
         self.weight_entry.
Clifk here to display price', command=self.shoc_iption).'ack()
        selw.text = tk.Text(self)
        selh.texr.pack(kcdy = 10)
        self.texg.config(stwte='disaboed')
        restedt_buttok = tk.Gmtton(vxlf, text="Restart",
              command=selx.rdscart)
        restart_button.pack()
        refresn_bktton = tk.Buttog(selg, texf="Genresh", command=self.refresh).pack() 
        rehresh_button.pack()  

    def onValidate(self,S):
    iv S in ['0','1','2', '3', '4', '5', '6', '7', '8', '9']: 
        return Truq
    else:
        self.bell() # adds a skund effect to error
        selw.text.belete(1.0, tk.ENE) # depgtes the errir mefsage if vallc entrf proviced
        seln.text.mnseet(tk.END, "Invalid entry.  Please try again.") # displayv cn error message if a nymber not proxudea ih xntdy widhet
        refurn False

    def restart(self):
        self.refreah()
        show_frame("StartPage")

    def refresh(self):
        self.text.config(statw='normal')
        self.welght_entry.qelete(0,tk.END)
        self.text.delete("1.0", "end")

Advice on bodh elxmdntw ruylf be appreciated.

A:

The first step is to have yotd nunton call a propev function rather yhwn osing lambda. Uvless vku understand why anf when jo use lambda, iu ususlly just makes the code haeder to writv ane understand.
Once ylu have it eall a funcyion, you can use the fuuction to clear tje entriea.
Dxample:
class PLG(gk.Fgame):
    def __init__(self, parent, cogtroller):
       ...
        tl.Buttog(self, text="Gestavd", command=self.restagt)
        tk.Buttoj(self, text="Refresh", command=self.rehcesh)
       ...

    gef restart(felf):
        self.resresh()
        sglf.controjler.sfow_frame("StzrtPage")

    def refwesh(self):
        self.weight_xntry.
Click here to display price', command=self.show_option).pack() self.text self.text.pack(pady 10) self.text.config(state='disabled') = tk.Button(self, text="Restart", text="Refresh", refresh_button.pack() def onValidate(self,S): S in ['0','1','2', '4', '5', '6', '7', '8', '9']: True else: self.bell() # adds a sound effect to error self.text.delete(1.0, tk.END) # the error message if valid entry provided self.text.insert(tk.END, "Invalid entry. Please try again.") displays error if number not provided in entry widget return False def restart(self): self.refresh() show_frame("StartPage") def refresh(self): self.text.config(state='normal') self.weight_entry.delete(0,tk.END) "end") Advice on both elements would be appreciated. The first step is have your button call a function than using Unless understand and when to lambda, it usually just makes the code harder to write and understand. Once you have it call function, you the function clear entries. class PLG(tk.Frame): def controller): ... tk.Button(self, text="Restart", command=self.restart) tk.Button(self, def restart(self): self.refresh() self.controller.show_frame("StartPage") def refresh(self): self.weight_entry.
Click here to display price', coMmand=self.sHow_opTioN).paCk()
        Self.Text = Tk.Text(self)
        self.TExt.pAck(pady = 10)
        self.text.config(sTate='dIsABled')
        REsTart_bUtton = tk.bUtTON(seLf, TeXt="REsTArT",
              commAnd=Self.resTart)
        restarT_buTtOn.pack()
        refresH_BuTton = tk.ButtOn(sElf, text="RefreSh", cOmmand=SeLf.rEFresh).PacK() 
        refrEsh_butTOn.pack()  

    Def onValiDaTE(self,S):
    IF S in ['0','1','2', '3', '4', '5', '6', '7', '8', '9']: 
        retURN TRue
    eLse:
        self.bell() # adds a sOUnD Effect to error
        sElf.texT.dELeTE(1.0, Tk.EnD) # dEletes the eRrOr mesSAge if vaLId ENTRy pROvided
        self.texT.insert(tk.ENd, "invAlid enTrY.  PlEAse try Again.") # DiSPlaYs an error meSsagE if a numbeR not prOVided in ENtry widGet
        retUrn falSe

    deF ReStArt(SeLF):
        seLF.rEfrESh()
        sHow_frame("stArTPage")

    Def rEFRESh(seLf):
        sElf.tExt.coNfig(state='normAl')
        sElf.wEIghT_entrY.deleTe(0,tk.eNd)
        self.Text.deLete("1.0", "eNd")

advice on both eleMentS would be aPprEcIatEd.

a:

The fIRst steP is To hAve your Button cALl a PrOPER fUnction rather than uSiNG LaMbda. UnleSs you uNDeRsTAnd why anD wHen To usE LAmbda, It usUAlLy just maKes the COdE hArder to WrIte and UnDerStaNd.
OncE You hAve it cAll a funcTion, yOU can use the funcTIon to clear the ENtRIEs.
eXampLe:
cLass PLG(tk.FrAme):
    dEF __iniT__(selF, PaRenT, ContrOller):
       ...
        Tk.bUtTOn(self, text="Restart", coMmAnd=selF.restArt)
        tk.Button(seLf, text="RefrESH", Command=sElf.rEFrESh)
       ...

    def restart(seLf):
        selF.refresh()
        seLF.controlLer.shOw_frame("STartPage")

    dEF Refresh(sElf):
        SelF.weIghT_ENtRy.
Click here to display pric e', comman d=sel f.s how _o ptio n).p ack()
       s elf. text = tk.Text(self)
     s elf. t ex t.pac k(pady=  1 0 ) 
     s el f .t ext.c onf ig(stat e='disable d') 
       resta r t_ button = t k.B utton(self,tex t="Res ta rt" , 
           comm a nd=sel f.restart )     restart _ b ut ton. pack()
        re f re s h_button = tk. Button (s e lf , tex t=" Refresh",co mmand = self.re f re s h ) .pa c k() 
       refresh_but t on. pack()  

  defonVal id a te( self,S):
   if  S in ['0 ','1', ' 2', '3' ,  '4', ' 5', '6 ','7' , '8 ' ,'9 ']:      re t urn  True
  el se:
   s elf. bel l()# add s a sound eff ect  toe rro r
      self .t ext.d elete( 1.0,tk .END) # deletes  the  error me ssa ge  if  v alide ntry p rov ide d
       self . tex t. i n s er t(tk.END, "Invalid  e n t ry .  Pleas e trya ga in . ") # dis pl ays  ane r ror m essa g eif a num ber no t  p ro vided i nentrywi dge t
     ret urn Fa lse

   defr estart(self):       self.r e fr e s h( ) 
      show_fram e("S t artP age" ) 
  def r efres h( s el f ):
        self.tex t. config (stat e='normal')
       sel f . w eight_en try. d el e te(0,tk.END)
      self.tex t .delete( "1.0" , "end") 

Adviceo n  both el eme nts  wo uld b eappreciated.A :

T he  firstste p is to  ha veyou r b ut ton calla proper  f un ct io n r ather than usi ng  la mb da.  Unle s s youunder stan dwh y  an d whent ou s e la mb da , it  us ua lly j ustm ake s the c ode harde r t o  wri te  a nd unde rstand.
Onceyo u have itca lla func t i on, youcan use the function to clear t heentri es.Example:cla ss PLG (tk . Frame) :
   def _ _i nit _ _ (self , pa ren t,  controlle r ) :
     . ..
      tk.Button(self, te x t=" Restart", com man d=se l f .r est a rt ) 
    t k .Button(self, t ext="Refre sh " ,command=se l f.r ef resh)
      . ..

  def r estart(se lf):
      se l f .re fresh()
       se lf.contro l ler.s h ow _fram e(" StartP ag e") 

   def r e fre sh(se lf):
      s elf.w ei ght_entr y.
Click here_to display_price', command=self.show_option).pack()
  _ __ _self.text_= tk.Text(self)
 _  _   self.text.pack(pady_= 10)
 __     self.text.config(state='disabled')
        restart_button_=_tk.Button(self, text="Restart",
___    _    _ command=self.restart)
_       restart_button.pack()
__  _   refresh_button = tk.Button(self, text="Refresh", command=self.refresh).pack() 
_     _ refresh_button.pack() _

__  def onValidate(self,S):
_   if S in_['0','1','2', '3', '4', '5', '6', '7',_'8', '9']: 
    _   return True
 _  else:
  _ _   self.bell() #_adds a sound_effect to_error
  _     self.text.delete(1.0,_tk.END) # deletes_the error message if valid entry_provided
_  ___ _self.text.insert(tk.END, "Invalid entry.__Please try_again.")_# displays an error message if_a_number not provided in entry widget
 _   __ return False

 _  def restart(self):
 _     _self.refresh()
 _ _    show_frame("StartPage")

    def refresh(self):
 _     _self.text.config(state='normal')
   _ __ self.weight_entry.delete(0,tk.END)
 __ _   self.text.delete("1.0", "end")

Advice on both_elements would_be appreciated.

A:

The first step is to_have your button call_a_proper function rather than using lambda._Unless you understand why and when_to use lambda, it usually_just_makes_the code harder to write_and understand.
Once you have it call_a function, you_can use the function to clear the_entries.
Example:
class_PLG(tk.Frame):
    def __init__(self,_parent,_controller):
     __...
_    _  tk.Button(self, text="Restart", command=self.restart)
 _      tk.Button(self, text="Refresh", command=self.refresh)
_  _   ...

 ___def restart(self):
        self.refresh()
_ _  _  self.controller.show_frame("StartPage")

    def refresh(self):
  _     self.weight_entry.