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

G. Willoughby thecalm at NOSPAM.btinternet.com
Wed Jul 4 18:37:22 EDT 2001


Yes thats it! if i shift the grid statement to a new line, all is ok,

ta,

Gary.


"XiaoQin Xia" <XQ.Xia at ccsr.cam.ac.uk> wrote in message
news:3B42E57D.B9D11046 at ccsr.cam.ac.uk...
Dear G. Willoughby,
I think the problem is in the line:
newName=Entry(frame1).grid(row=1,column=0)
# here newName is the return value of grid(), i.e, None, instead of a Entry
object.
things may be better if you write as:
newName=Entry(frame1)
newName.grid(row=1,column=0)
Cheers,
Xia Xiao-Qin
"G. Willoughby" wrote:
i'm trying to get user input from a Tkinter Entry field, this is the code i
am using:
[snip...]
def getNew():
    result1=str(newName.get())
    print result1
[snip...]
Button(frame1, text="Add New Entry", command=getNew).grid(row=0,column=0)
newName=Entry(frame1).grid(row=1,column=0)
[snip...]
it somehow doesn't work, any ideas?
P.S. no classes are used anywhere in this program.
G. Willoughby





More information about the Python-list mailing list