Python 我想从super class loginform中获取名为userE的条目的文本,以组成电子邮件类
这是我的超级类,删除了不必要的代码Python 我想从super class loginform中获取名为userE的条目的文本,以组成电子邮件类,python,user-interface,tkinter,inheritance,pycharm,Python,User Interface,Tkinter,Inheritance,Pycharm,这是我的超级类,删除了不必要的代码 类登录表单: 全局用户名 定义初始化(自,根): #=========================================================根目录===================================== self.root=根 self.root.geometry('1350x700+100+50') self.root.configure(background=“orange”) self.root.title(“
类登录表单:
全局用户名
定义初始化(自,根):
#=========================================================根目录=====================================
self.root=根
self.root.geometry('1350x700+100+50')
self.root.configure(background=“orange”)
self.root.title(“Bmail-登录/登录”)
self.userE=tk.Entry(master=frame,font=(“Verdana,Bold”,11),bg=“white”,fg=“grey”,width=50)
self.userE.place(x=90,y=355)
passl=tk.Label(text=“password:”,master=frame,font=(“Verdana,Bold”,11)).place(x=10,y=390)
def访问功能(自身、事件):
撰写电子邮件
我想访问self.userE.cget(“text”),但它不给我任何信息,绑定func错误或进入无限循环
这是我的composemail(child)类
请帮我解决这个问题……这是太多的代码,我们无法调试。请删除所有不必要的详细信息。立即删除不必要的代码。请帮助我,而不是使用
self.userE.cget(“text”)
useself.userE.get()
。不工作,数据被删除super().init()加载在compose class@thelizzardc的init中。请用完整的最小工作示例编辑您的问题?使用super()。\uuu init\uuuu()
时删除数据是什么意思?也可能对你有帮助
access = loginform
class compose_mail(access):
def __init__(self, root):
obj1=super().__init__(root)
self.root = root
self.root = Toplevel()
self.root.title("Bmail-Compose Mail form")
self.root.geometry("1350x700+100+50")
self.root.resizable(False, False)
self.root.configure(bg="orange")
self.luser = Label(cframe, bg="yellow", width=50, text=self.acc)
self.luser.place(x=20, y=650)
def acc(self):
a=self.userE.cget("text")
root=tk.Tk()
obj=loginform(root)
obj.root.mainloop()