我正在尝试运行python项目,但我一直收到此错误
Tkinter回调中的异常
#third-column {
width: 15%;
height: 80%;
background-color: #d8d8d8;
float: right;
}
footer {
background-color: #222222;
height: 10%;
width: 70%;
bottom: 0;
float: left;
}
任何人都可以帮助我http://pastebin.com/qDv7R1tA
答案 0 :(得分:0)
这是你的职能createb
:
def createb():
creator = tkinter.Tk()
creator.geometry("800x768")
creator.title("Pyhton Business Creator")
global Type
Type = 0
def HD1():
global Type
Type = 1
global owner
owner = 1
if cash > 12500:
HD2 = tkinter.Button(createb, text="Hairdresser Business")
HD2.pack
create = tkinter.Button(createb, text="Create Business")
creator.mainloop()
您正在尝试在函数上创建一个按钮,这当然是不可能的。 所以而不是:
HD2 = tkinter.Button(createb, text="Hairdresser Business")
create = tkinter.Button(createb, text="Create Business")
类型:
HD2 = tkinter.Button(creator, text="Hairdresser Business")
create = tkinter.Button(creator, text="Create Business")
顺便说一句,它应该是HD2.pack()
而不是HD2.pack
。