how to make a loading bar in python code example
Example 1: how to make a loading bar in python
import os
from tqdm import tqdm
from colorama import Fore, Back, Style
import time
for i in tqdm (range (101),
desc=Fore.GREEN + "Loading. . .",
ascii=False, ncols=75):
time.sleep(0.01)
print(Fore.GREEN + "Complete. . .")
time.sleep(1)
os.system('cls' if os.name == 'nt' else 'clear')
Example 2: how to make loading in python
import time
import sys
done = 'false'
def animate():
while done == 'false':
sys.stdout.write('\rloading |')
time.sleep(0.1)
sys.stdout.write('\rloading /')
time.sleep(0.1)
sys.stdout.write('\rloading -')
time.sleep(0.1)
sys.stdout.write('\rloading \\')
time.sleep(0.1)
sys.stdout.write('\rDone! ')
animate()
done = 'false'
Example 3: python progress bar
from tqdm import tqdm
for i in tqdm(range(0,int(10E6))):
continue