-
Notifications
You must be signed in to change notification settings - Fork 0
/
loading_anim.py
47 lines (42 loc) · 933 Bytes
/
loading_anim.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import time
import os
def clear():
os.system("clear")
def sleep(num):
time.sleep(num)
def loading_animation(times_repeated):
acum = 0
while True:
print("Loading")
sleep(0.2)
clear()
print("Loading.")
sleep(0.2)
clear()
print("Loading..")
sleep(0.2)
clear()
print("Loading...")
sleep(0.2)
clear()
acum += 1
if acum == times_repeated:
break
def custom_loading_animation(text_for_loading, times_repeated):
x = 0
while True:
print(f"{text_for_loading}")
sleep(0.2)
clear()
print(f"{text_for_loading}.")
sleep(0.2)
clear()
print(f"{text_for_loading}..")
sleep(0.2)
clear()
print(f"{text_for_loading}...")
sleep(0.2)
clear()
x += 1
if x == times_repeated:
break