-
Notifications
You must be signed in to change notification settings - Fork 0
/
demo.py
87 lines (66 loc) · 1.92 KB
/
demo.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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import consloadingbar, time
time.sleep(0.1)
print(end='\r')
clb = consloadingbar.Bar(title='ProgressBar 1', taskCount=10, useColor=True)
for i in range(101):
clb.progressBar(i, tasksDone=i//10)
time.sleep(0.02)
time.sleep(0.1)
print()
clb = consloadingbar.Bar(title='ProgressBar 2', mainBarChar='#', endPointChars=['[', ']'])
start = time.time()
for i in range(101):
percentageT = time.time() - start
clb.progressBar(i, time_=percentageT)
time.sleep(0.02)
time.sleep(0.1)
print()
clb = consloadingbar.Bar(title='ProgressBar 3', mainBarChar='▣', emptyBarChar='▢')
for i in range(101):
clb.progressBar(i)
time.sleep(0.02)
time.sleep(0.1)
print()
clb = consloadingbar.Bar(title='ProgressBar 4', mainBarChar='◉', emptyBarChar='◯')
for i in range(101):
clb.progressBar(i)
time.sleep(0.02)
time.sleep(0.1)
print()
clb = consloadingbar.Bar(title='ProgressBar 5', emptyBarChar='●')
for i in range(101):
clb.progressBar(i)
time.sleep(0.02)
time.sleep(0.1)
print()
clb = consloadingbar.Bar()
clb.counter(2, start=0, end=100, title='Counter 1')
time.sleep(0.1)
print()
clb.counter(2, start=100, end=0, title='Counter 2')
time.sleep(0.1)
print()
clb.spinner(time_=2, title='Spinner 1')
time.sleep(0.1)
print()
clb.spinner(time_=2, title='Spinner 2', phases=['◷', '◶', '◵', '◴'])
time.sleep(0.1)
print()
clb.spinner(time_=2, title='Spinner 3', phases=['◑', '◒', '◐', '◓'])
time.sleep(0.1)
print()
clb = consloadingbar.Bar()
clb.spinner(time_=2, title='Spinner 4', phases=['⎺', '⎻', '⎼', '⎽', '⎼', '⎻'])
time.sleep(0.1)
print()
clb.spinner(time_=4.7, title='Spinner 5', phases='preset')
time.sleep(0.1)
print()
for i in range(101):
clb.progressChar(percentage=i, title='ProgressChar 1')
time.sleep(0.01)
time.sleep(0.1)
print()
for i in range(101):
clb.progressChar(percentage=i, title='ProgressChar 2', phases=['○', '◔', '◑', '◕', '●'])
time.sleep(0.01)