[Tutor] Fun with Label and Entry--Why NoneType?

Alan Gauld alan.gauld at btinternet.com
Tue Mar 17 22:19:07 CET 2009


"Wayne Watson" <sierra_mtnview at sbcglobal.net> wrote

> Yet the print "here" statement produces:
>    here None <type 'NoneType'>
> I'm missing something. The NoneType causes the print of the self.lat 
> to fail with get().

>        self.long=Entry(master, width=12).grid(row=0, column=3)

The placement methods(pack, grod etc) all return None.
You must run them as a separate line if you want to get a reference to 
the widget.

self.long=Entry(master, width=12)
self.long.grid(row=0, column=3)



HTH,


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/




More information about the Tutor mailing list