-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprogressbar.py
52 lines (36 loc) · 1.3 KB
/
progressbar.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
48
49
50
51
52
def progressbaring(inTakeFiles, allFiles):
theBar = ["[","_","_","_","_","_","_","_","_","_","_","]"]
percent = inTakeFiles/allFiles * 100
if percent <= 100 and percent >= 90:
theBar[1] = "O"
elif percent <= 90 and percent >= 80:
for i in range(1, 2):
theBar[i] = "O"
elif percent <= 80 and percent >= 70:
for i in range(1, 3):
theBar[i] = "O"
elif percent <= 70 and percent >= 60:
for i in range(1, 4):
theBar[i] = "O"
elif percent <= 60 and percent >= 50:
for i in range(1, 5):
theBar[i] = "O"
elif percent <= 50 and percent >= 40:
for i in range(1, 6):
theBar[i] = "O"
elif percent <= 40 and percent >= 30:
for i in range(1, 7):
theBar[i] = "O"
elif percent <= 30 and percent >= 20:
for i in range(1, 8):
theBar[i] = "O"
elif percent <= 20 and percent >= 10:
for i in range(1, 9):
theBar[i] = "O"
elif percent <= 10:
for i in range(1, 10):
theBar[i] = "O"
leResult = ""
for i in range(len(theBar)):
leResult = leResult + theBar[i]
print(leResult + " " + str(percent) + "%")