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


Groups > comp.lang.python > #8588

Re: get() attribute for Entry in Tkinter

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'python': 0.08; 'attribute': 0.09; 'none.': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:80.91.229.12': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'received:lo.gmane.org': 0.09; 'tkinter': 0.09; 'exception': 0.12; 'gui': 0.13; 'wrote:': 0.15; 'callback': 0.16; 'received:dip.t-dialin.net': 0.16; 'received:t-dialin.net': 0.16; 'subject:() ': 0.16; '(most': 0.21; "python's": 0.25; 'traceback': 0.25; 'says': 0.25; 'messages.': 0.25; 'string': 0.26; 'skip:" 30': 0.28; 'problem': 0.29; 'object': 0.30; 'from:addr:web.de': 0.30; 'widget': 0.30; 'error': 0.31; 'print': 0.32; 'does': 0.32; 'entry': 0.33; 'reference': 0.33; 'to:addr:python-list': 0.34; 'header:X-Complaints-To:1': 0.34; 'test': 0.34; 'last):': 0.35; 'running': 0.35; 'file': 0.36; 'instead.': 0.37; 'could': 0.37; 'received:org': 0.38; 'subject:: ': 0.38; 'something': 0.38; 'should': 0.39; 'header:Mime-Version:1': 0.39; 'skip:e 20': 0.39; 'to:addr:python.org': 0.39; 'where': 0.40; 'give': 0.60; "'nonetype'": 0.84; '__call__': 0.84; 'paraphrase': 0.84; 'engaging': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Peter Otten <__peter__@web.de>
Subject Re: get() attribute for Entry in Tkinter
Date Wed, 29 Jun 2011 23:35:08 +0200
Organization None
References <3e0341d0-e045-4f93-a816-1b304de4cd80@h12g2000pro.googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding 7Bit
X-Gmane-NNTP-Posting-Host p5084a729.dip.t-dialin.net
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.514.1309383320.1164.python-list@python.org> (permalink)
Lines 30
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1309383320 news.xs4all.nl 21851 [2001:888:2000:d::a6]:40748
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:8588

Show key headers only | View raw


Robert Upton wrote:

> I am in the process of generating a simple GUI that wants to read a
> string and print it to the terminal after engaging a button.  I am
> running into a problem where Python says it does not understand the
> get() attribute for Entry.  

Please don't paraphrase Python's error messages. Cut-and-paste the traceback 
instead. This should give something like

$ python tmp_tk.py
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.6/lib-tk/Tkinter.py", line 1413, in __call__
    return self.func(*args)
  File "tmp_tk.py", line 6, in Test
    strVal = widgetEntry.get()
AttributeError: 'NoneType' object has no attribute 'get'

So the value of widgetEntry is None. How could that be?

> widgetEntry = Entry(textFrame).pack(side = LEFT)

The pack() method returns None; if you need a reference to the Entry widget 
you have to split that line

widgetEntry = Entry(textFrame)
widgetEntry.pack(side=LEFT)

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


Thread

get() attribute for Entry in Tkinter Robert Upton <yybar85712@gmail.com> - 2011-06-29 12:15 -0700
  Re: get() attribute for Entry in Tkinter Peter Otten <__peter__@web.de> - 2011-06-29 23:35 +0200

csiph-web