博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
tkinter 获取输入框的值AttributeError: 'NoneType' object has no attribute 'get'解决办法
阅读量:4170 次
发布时间:2019-05-26

本文共 255 字,大约阅读时间需要 1 分钟。

AttributeError: ‘NoneType’ object has no attribute ‘get’

当使用如下代码时,会出现如题错误

ent2=Entry(root,width=10).place(x=20,y=40,anchor='nw')num=ent2.get()

解决方法:

改为

ent2=Entry(root,width=10)ent2.place(x=20,y=40,anchor='nw')num=ent2.get()

即可正常运行

原因:place,pack,grid有副作用。

转载地址:http://ykwai.baihongyu.com/

你可能感兴趣的文章
SpringBoot之外置Tomcat配置
查看>>
java 删除 list 中的元素
查看>>
idea启动优化
查看>>
java发展史
查看>>
Java内存区域
查看>>
数据库与模式的区别
查看>>
数字签名的原理
查看>>
showDialog
查看>>
Flex 拖拽范例
查看>>
flash builder 4 编译器参数
查看>>
flex常用网站
查看>>
flex 页面跳转
查看>>
cat | wc -l 少一行的问题
查看>>
socket 科普文章
查看>>
Mutex, semaphore, spinlock的深度解析
查看>>
pthread线程使用小结
查看>>
A Game of Thrones(59)
查看>>
2018.3.19
查看>>
A Game of Thrones(97)
查看>>
A Game of Thrones(98)
查看>>