Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #103417

exit from Tkinter mainloop Python 2.7

Newsgroups comp.lang.python
Date 2016-02-23 13:39 -0800
Message-ID <56e451a3-01f7-4883-b4db-c3a6a10729a9@googlegroups.com> (permalink)
Subject exit from Tkinter mainloop Python 2.7
From kevind0718@gmail.com

Show all headers | View raw


Hello:



Newbie here.

Spent the a good part of the day tinkering and reading tutorials,
I was able to create a sample that is very close to my requirement.

When I execute the code below the Dialog displayed as expected and
I can enter data into the textboxes.  All good.

When I click on butGo I get the error below.
So is this some sort of scope error?
why does entryName not exist for me to grab it's value?

Your kind assistance is requested.


Traceback (most recent call last):
  File "C:\Users\kduffy12\workspace\testPythonA\testA\simpleDialog.py", line 25, in <module>
    print entryName.get("1.0", "end-1c" )
AttributeError: 'NoneType' object has no attribute 'get'




from Tkinter import *


def butContinue():
    root1.destroy()

root1 = Tk()
root1.geometry("500x250")


lblTop = Label(root1, text= '      Enter Values Below', font="Helvetica 14").grid(row=0, column=0, columnspan=2 , pady=5)
##lblTop.pack(side = TOP)

lblDB = Label(root1,    text= '    Weight').grid(row=1, column=0 )
lblPWord = Label(root1, text= '    Height').grid(row=2,column=0)
entryName = Entry(root1).grid(row=1, column=1, pady=5)

entryPWord = Entry(root1).grid(row=2, column=1, pady = 5)

butGo  =  Button(root1, text="   Continue "  , command=butContinue ).grid(row=3, column=1, sticky=W, pady=10)


root1.mainloop()

print entryName.get("1.0", "end-1c" )
print entryPWord.get("1.0", "end-1c" )

Back to comp.lang.python | Previous | NextNext in thread | Find similar | Unroll thread


Thread

exit from Tkinter mainloop  Python 2.7 kevind0718@gmail.com - 2016-02-23 13:39 -0800
  Re: exit from Tkinter mainloop Python 2.7 Christian Gollwitzer <auriocus@gmx.de> - 2016-02-23 23:29 +0100
    Re: exit from Tkinter mainloop Python 2.7 Peter Otten <__peter__@web.de> - 2016-02-23 23:45 +0100
  Re: exit from Tkinter mainloop Python 2.7 Christian Gollwitzer <auriocus@gmx.de> - 2016-02-23 23:33 +0100
    Re: exit from Tkinter mainloop Python 2.7 kevind0718@gmail.com - 2016-03-04 13:50 -0800
      Re: exit from Tkinter mainloop Python 2.7 Peter Otten <__peter__@web.de> - 2016-03-04 23:28 +0100
      Re: exit from Tkinter mainloop Python 2.7 Rick Johnson <rantingrickjohnson@gmail.com> - 2016-03-09 11:17 -0800
  Re: exit from Tkinter mainloop  Python 2.7 Dave Farrance <df@see.replyto.invalid> - 2016-02-24 09:34 +0000

csiph-web