python如何实现带时间的普通进度条
导读:本文共471.5字符,通常情况下阅读需要2分钟。同时您也可以点击右侧朗读,来听本文内容。按键盘←(左) →(右) 方向键可以翻页。
摘要: 带时间的普通进度条第2种同样通过print进行打印进度条,不过还加入了time时间显示,显示进度过程中所需要的时间t=60print("**************带时间的进度条**************")start=time.perf_counter()foriinrange(t+1):finsh="▓"*i... ...
音频解说
目录
(为您整理了一些要点),点击可以直达。带时间的普通进度条
第2种同样通过print进行打印进度条,不过还加入了time时间显示,显示进度过程中所需要的时间
t=60print("**************带时间的进度条**************")start=time.perf_counter()foriinrange(t+1):finsh="▓"*ineed_do="-"*(t-i)progress=(i/t)*100dur=time.perf_counter()-startprint("\r{:^3.0f}%[{}->{}]{:.2f}s".format(progress,finsh,need_do,dur),end="")time.sleep(0.05)
</div> <div class="zixun-tj-product adv-bottom"></div> </div> </div> <div class="prve-next-news">
本文:
python如何实现带时间的普通进度条的详细内容,希望对您有所帮助,信息来源于网络。