LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   [Python] Cannot insert variable into "Entry" (https://www.linuxquestions.org/questions/programming-9/%5Bpython%5D-cannot-insert-variable-into-entry-4175428829/)

Mr. Alex 09-24-2012 01:45 PM

[Python] Cannot insert variable into "Entry"
 
Hi. I have this code in P3000 that returns an error: "AttributeError: 'NoneType' object has no attribute 'insert'".
Code:

    title = Entry(news, width=20).grid(row=1,column=0)
    title.insert(0, row[0])

row[0] is a string var containing some text.
I searched for the error text. One of answers is:
Quote:

NoneType means that instead of an instance of whatever Class or Object you think you're working with, you've actually got None. That usually means that an assignment or function call up above failed or returned an unexpected result.
But I don't know how to fix it. Text is not getting inserted into that entry.
Python 3 and tkinter.

dugan 09-24-2012 02:03 PM

The call to .grid() is returning None.


All times are GMT -5. The time now is 11:23 AM.