【发布时间】:2022-01-25 06:23:19
【问题描述】:
您好,提前感谢您的帮助, 事实上,我有一个带有各种选项的进度条,我希望看到这些选项被刷新,而不是花时间清理控制台。
while True :
#system("cls")
sys.stdout.write("\rSearching for {} --- [Currently {} found] \nLoading [".format(entry, count_result) + "="*int(100 * count / nb_files) + " "*(100-int(100 * count / nb_files)) + "] {}%".format(int(round(float(int(100 * count / nb_files))))) + "\n")
sys.stdout.flush()
sleep(0.5)
if int(100 * count / nb_files) == 100 :
sleep(1)
system("cls")
break
所以我很想知道是否有办法,我到处寻找以试图理解,但我不明白在我的情况下我该怎么做。提前致谢
【问题讨论】:
-
使用这个 --> github.com/tqdm/tqdm 而不是试图建立一个进度条
-
谢谢,但我不想使用外部库。我想了解它是如何工作的并用这种风格来做
标签: python python-3.x printing stdout sys