-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdisplay.py
60 lines (47 loc) · 1.71 KB
/
display.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
#!/usr/bin/env python
# -*- coding:utf-8 -*-
from os import system
import setting as s
def copyright():
system("clear")
print(
" _ ____\n\
___ ___ _ __ ___ _ __ _ _| |_ ___ _ __ __ _|___ \ \n\
/ __/ _ \| '_ ` _ \| '_ \| | | | __/ _ \| '__| \ \ / / __) |\n\
| (_| (_) | | | | | | |_) | |_| | || (_) | | \ V / / __/ \n\
\___\___/|_| |_| |_| .__/ \__,_|\__\___/|_| \_/ |_____| v0.1\n\
|_| \n\
"
)
print("Copyright 2019-2020, 2019 Free Software Kevin Foundation, Inc.".center(65))
print("This is free software with ABSOLUTELY NO WARRANTY.\n\n".center(65))
def colorText(value, color="31"):
return "\x1b[" + color + "m" + value + "\x1b[0m"
def format_matrix(matrix, mode=0):
if mode == 1:
matrix = matrix.replace("],[", "]\n\t [")
else:
matrix = matrix.replace("],[", "]\n[")
matrix = matrix.replace("[[", "[")
matrix = matrix.replace("]]", "]")
return matrix
def show_datas():
empty_data = 0
for type_name, vars in s.datas.items():
if len(vars) == 0:
empty_data += 1
continue
print("-------------------------")
print(colorText(type_name, "36"))
for var_name, val in vars.items():
if type_name == "matrices":
print("\t" + var_name, "->\n\t", format_matrix(val, 1))
else:
print("\t" + var_name, "->", val)
if empty_data == 4:
print(colorText("No variable saved.\x1b[0m"))
print("-------------------------")
def print_com(data):
print(colorText(data, "33"))
def usage():
print("usage: ")