Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
259 views
in Technique[技术] by (71.8m points)

python - AttributeError: 'NoneType' object has no attribute 'insert'


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

c is equal to the return value of grid() not the return value of Entry(). You therefore never saved a reference to the entry box itself.

You should split the calls of creation and layout as such:

c = Entry(root, width=25, borderwidth=5, font=('Helvetica 18 bold'), bg="#E8E8E8")
c.grid(row=0, column=0, columnspan=8, padx=10, pady=10)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...