-
Notifications
You must be signed in to change notification settings - Fork 0
/
interface.py
75 lines (64 loc) · 1.44 KB
/
interface.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
import os
from time import sleep
from art import tprint
import tabulate
def system(command):
os.system(command)
def echo(text):
os.system(f"echo {text}")
def color(numOfColor):
os.system(f"color {numOfColor}")
def update():
os.system(f"cls")
def cmdLines(TrueFalse):
update()
if TrueFalse:
echo("ON")
else:
echo("OFF")
def otchot(mode, a, b, delay):
if mode == 1:
for i in range(a, b+1):
print(i)
sleep(delay)
elif mode == 2:
for i in range(a, b+1):
update()
print(i)
sleep(delay)
elif mode == 3:
for i in reversed(range(a, b+1)):
print(i)
sleep(delay)
elif mode == 4:
for i in reversed(range(a, b+1)):
update()
print(i)
sleep(delay)
def loading(text, timeS, fontColor):
slp = timeS/100
if fontColor:
color(fontColor)
for i in range(100):
update()
if i & 1:
print(f"{text} .")
elif i & 2:
print(f"{text} ..")
else:
print(f"{text} ...")
sleep(slp)
def aprint(text):
tprint(text)
def asleep(time):
sleep(time)
def textAnimation(text, sleeep):
ttla = ""
for i in range(len(text)):
update()
ttla += text[i]
color(i)
aprint(ttla)
asleep(sleeep)
def atabulate(list):
return tabulate.tabulate(list)