i'm trying to get user input from a Tkinter Entry field...

Steven Cummings stevenc at engineer.com
Thu Jul 5 18:00:45 CEST 2001


"G. Willoughby" <thecalm at NOSPAM.btinternet.com> wrote in message news:<9i05or$fl5$1 at plutonium.btinternet.com>...
> Yes thats it! if i shift the grid statement to a new line, all is ok,
> 
> ta,
> 
> Gary.

For future reference, this is because the grid, pack, and place
methods don't return the widget itself (in fact they return None).
This is why you need the widget creation and grid-placement on two
separate lines. You typically only call grid, pack, or place on the
same line as construction when you don't keep a reference to the
widget as is common with labels:

from Tkinter import *
root = Tk()
...
...
Label(root, text="I'm a label!").pack(side=LEFT)

Hope this helps more generally.

/S



More information about the Python-list mailing list