我有这个密码:
from tkinter import *
Import random
Import time
Root=Tk ()
Root. geometry ("1600x800+0+0")
Root. title ("Resaurant Management System")
Tops = Frame(root, width=1600 ,bg="powder blue",relief=SUNKEN)
Tops.pack(side=TOP)
f1 = Frame(root, width=800,height=700 ,bg="powder blue",relief=SUNKEN)
f1.pack(side=LEFT)
f2 = Frame(root, width=300,height=700 ,bg="powder blue",relief=SUNKEN)
f2.pack(side=RIGHT)
root.mainloop()
我有个错误:
Traceback (most recent call last):
File "C:/Users/ersur/Downloads/restorent_mang_sy.py", line 11, in <module>
Tops.pack(side=TOP)
File "C:\Users\ersur\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 2738, in __init__
Widget.__init__(self, master, 'frame', cnf, {}, extra)
File "C:\Users\ersur\AppData\Local\Programs\Python\Python36-32\lib\tkinter\__init__.py", line 2293, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: can't invoke "frame" command: application has been destroyed
“Import”中的大写“I”会产生语法错误。将其更改为“导入”。你知道吗
在top、f1和f2中,将“root”改为“root”,因为“root”没有定义
相关问题 更多 >
编程相关推荐