tkinter - 此代码显示错误:-- AttributeError: 'NoneType' object has no attribute 'get'
问题描述
''' '这显示错误' '请帮我解决这个问题'
from tkinter import *
root=Tk()
def loginc():
print(e1.get()) #getting value of entry
l=Label(root)
f=Frame(l,pady="25",padx="25")
lb1=Label(f,text="Enter ID: ",font="lucida 10 bold").grid(column=0,row=2,pady="4")
e1=Entry(f,width="28").grid(column=1,row=2)
lb2=Label(f,text="Enter Password: ",font="lucida 10 bold").grid(column=0,row=3,pady="4")
e2=Entry(f,width="28").grid(column=1,row=3)
btn=Button(f,text="login",bg="green",fg="white",width="10",font="lucida 10 bold",command=loginc)
btn.grid(columnspan=3,row=5,pady="10")
f.grid(column=0,row=6)
l.grid(column=0,row=7)
root.mainloop()
我怎么解决这个问题 '''
解决方案
推荐阅读
- stream - Dailymotion Live stream Api 中的“POST 视频”参数“publish”无效
- javascript - Django多对多字段的Javascript数组
- python - 如何从这两个文件中找到前 100 个名称?
- php - 数据库中存在单引号或双引号的 MySQL 搜索
- regex - 捕获组中的正则表达式负前瞻
- aws-lambda - Amazon Cloudwatch JSON 格式不正确
- ios - swift中关于委托和协议的问题(示例)
- java - Spring Boot 将数据发布到 url 实现
- java - 找不到 com.google.firebase:firebase-database:16.0.0。在以下位置搜索 android app
- json - 将 Groovy Json 解析为键值