tkinter python3中,为什么grid不能用?
代码:————————————————————————————————————————frompasswordimport*fromtkinterimport*deflo...
代码:————————————————————————————————————————from password import *from tkinter import *def login(): logwin=Tk() logwin.title("登录_宠物世界") username=Label(logwin,text='用户名:') username.grid(row=1,column=1) username.pack() password=Label(logwin,text='密码:') password.grid(row=1,column=2) password.pack() userent=Entry(logwin) userent.grid(row=2,column=1) userent.pack() passent=Entry(logwin) passent.grid(row=2,column=2) passent.pack()login()————————————————————————————————————————输出(报错):————————————————————————————————————————Traceback (most recent call last): File "/Volumes/我才不是硬盘(D) /Python/login.py", line 18, in <module> login() File "/Volumes/我才不是硬盘(D) /Python/login.py", line 10, in login password.grid(row=1,column=2) File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/tkinter/__init__.py", line 2226, in grid_configure + self._options(cnf, kw))_tkinter.TclError: cannot use geometry manager grid inside . which already has slaves managed by pack
展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询