【发布时间】:2015-05-14 07:35:37
【问题描述】:
我希望单击按钮时应显示标签,然后开始下载。但是在下面这种情况下,框架会卡住,比如如果下载需要 10 分钟就会卡住,并且标签只会在 10 分钟后显示。
def call():
test1()
test2()
def test1():
button.pack_forget()
label.pack()
def test2():
"script to start download which might take 10 min"
frame=Tk()
frame.pack()
button=Button(frame,text="clickme",command=call)
label=Label(frame,text="downloading...Please wait")
button.pack()
frame.mainloop()
【问题讨论】:
-
代码大麦的第一部分对 python 重新采样。每个函数定义都应该有
def。如果代码不完整,很难提供帮助。
标签: python button tkinter label