Open Pin-Jiun opened 1 year ago
https://stackoverflow.com/questions/3002085/how-to-print-out-status-bar-and-percentage https://www.codingem.com/progress-bar-in-python/ https://www.pythonpool.com/carriage-return-python/
from time import sleep
def progress(percent=0, width=40):
left = width * percent // 100
right = width - left
tags = "=" * left
spaces = " " * right
percents = f"{percent:.0f}%"
print("\r[", tags, spaces, "]", percents, sep="", end="", flush=True)
# Example run
for i in range(101):
progress(i)
sleep(0.05)
import progressbar
from time import sleep
bar = progressbar.ProgressBar(maxval=20, \
widgets=[progressbar.Bar('=', '[', ']'), ' ', progressbar.Percentage()])
bar.start()
for i in xrange(20):
bar.update(i+1)
sleep(0.1)
bar.finish()
window系統,可以按win+r,在對話框里面輸入“charmap
https://blog.csdn.net/Hello_Mr_Zheng/article/details/99352176