擅长:python、mysql、java
<p>在开始任务之前,需要强制更新GUI:</p>
<pre><code>def start():
count = 0
button1.configure(text="Busy!")
root.update() # < update window
while (count < 5):
root.after(1000)
count = count + 1
</code></pre>
<p>但是,如果您不希望在执行任务时冻结GUI,则需要使用Dedi建议的线程。你知道吗</p>