critic this please

Greg Ewing greg at cosc.canterbury.ac.nz
Mon Jun 25 02:06:31 EDT 2001


NJM wrote:
> 
>   a = float(Tkinter.Entry.get(feet))
>   b = float(Tkinter.Entry.get(inch))
>   Tkinter.Entry.delete(answer, 0, 20)
>   Tkinter.Entry.insert(answer, 0, (b/12 + a)*13)

Although it works in this case, that's not the way
objects are intended to be used! You should be doing
this:

  a = float(feet.get())
  b = float(inch.get())
  answer.delete(0, 20)
  answer.insert(0, (b/12 + a)*13)

-- 
Greg Ewing, Computer Science Dept, University of Canterbury,	  
Christchurch, New Zealand
To get my email address, please visit my web page:	  
http://www.cosc.canterbury.ac.nz/~greg



More information about the Python-list mailing list