【发布时间】:2016-10-14 10:26:20
【问题描述】:
我正在尝试编写一个代码,以便它显示从 1 到 100 的所有数字,以显示它正在加载的东西。
for i in range(101):
self.new = Label(self.label_progress, text=i)
time.sleep(1)
self.new.place(in_= self.label_progress)
if i == 100:
self.new1=Label(self.label_progress, text="the download is complete")
self.new1.place(in_=self.label_progress, x=50)
但它似乎在循环完成之前不想显示每个数字,最后它只显示 100。关于如何修复它的任何建议?
【问题讨论】:
-
如果不知道
Label是什么,就不可能知道发生了什么。你为什么不改用这个:pypi.python.org/pypi/progressbar2