import sys, time# 进度条的打印for i in range(20): sys.stdout.write('*') sys.stdout.flush() # 强制刷新 time.sleep(0.1)