1import time
2import sys
3
4done = 'false'
5#here is the animation
6def animate():
7 while done == 'false':
8 sys.stdout.write('\rloading |')
9 time.sleep(0.1)
10 sys.stdout.write('\rloading /')
11 time.sleep(0.1)
12 sys.stdout.write('\rloading -')
13 time.sleep(0.1)
14 sys.stdout.write('\rloading \\')
15 time.sleep(0.1)
16 sys.stdout.write('\rDone! ')
17
18animate()
19#long process here
20done = 'false'
1#pip install os
2#pip install time
3#pip install colorama
4#pip install tqdm
5import os
6from tqdm import tqdm
7from colorama import Fore, Back, Style
8import time
9
10for i in tqdm (range (101),
11 desc=Fore.GREEN + "Loading. . .",
12 ascii=False, ncols=75):
13 time.sleep(0.01)
14
15#the Fore.GREEN adds colour to the loading bar
16print(Fore.GREEN + "Complete. . .")
17time.sleep(1)
18#this will clear the terminal
19os.system('cls' if os.name == 'nt' else 'clear')