标签:pen 下载 play color hid else finish file event
import time def process(percent, width=30): percent = percent if percent <= 1 else 1 text=(‘\r[%%-%ds]‘%width)%(‘*‘*int(width*percent)) text=text+‘%d%%‘ text=text%(percent*100) print(text,end=‘‘) file_size=10240 cur_size=0 while True: time.sleep(0.01) cur_size+=20 process(cur_size/file_size,100) if cur_size>=file_size: print(‘‘) print(‘finish‘) break
标签:pen 下载 play color hid else finish file event
原文地址:https://www.cnblogs.com/xufengnian/p/10560265.html