import time import sys import random print("Loading:") #animation = ["10%", "20%", "30%", "40%", "50%", "60%", "70%", "80%", "90%", "100%"] animation = ["[■□□□□□□□□□]","[■■□□□□□□□□]", "[■■■□□□□□□□]", "[■■■■□□□□□□]", "[■■■■■□□□□□]", "[■■■■■■□□□□]", "[■■■■■■■□□□]", "[■■■■■■■■□□]", "[■■■■■■■■■□]", "[■■■■■■■■■■]"] def LoadingAnim(seconds): xz = int(seconds)/10 for i in range(len(animation)): time.sleep(xz) sys.stdout.write("\r" + animation[i % len(animation)]) sys.stdout.flush() print("\n") LoadingAnim(5)