Ver Fonte

PEP8 变量修正

Huan há 5 anos atrás
pai
commit
48ec3f7ad3

+ 3 - 0
.idea/dictionaries/.xml

@@ -0,0 +1,3 @@
+<component name="ProjectDictionaryState">
+  <dictionary name="宋子桓" />
+</component>

+ 6 - 0
.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding" defaultCharsetForPropertiesFiles="UTF-8">
+    <file url="PROJECT" charset="UTF-8" />
+  </component>
+</project>

+ 85 - 115
CGB/TK.py

@@ -3,7 +3,7 @@ from tkinter.filedialog import asksaveasfile
 import tkinter.messagebox
 from CGB import TK_HS
 
-help_doc = '''
+help_doc = """
 *快捷键:
     d-不用点击左键画线(再次点击关闭)
     g-画直线(2)
@@ -44,83 +44,85 @@ help_doc = '''
     绘制坐标系-三点绘制坐标系(使用中键选择点)
     保存-保存笔记为图片格式,保存一次后快捷键w可重复保存
     绘制函数-绘制基本初等函数和字定义解析函数
-'''
+"""
 
 
 def increasing_func_color():
     global increasing_color
-    increasing_color = askcolor(title='选择颜色')[0]
+    increasing_color = askcolor(title="选择颜色")[0]
 
 
 def subtraction_func_color():
     global subtraction_color
-    subtraction_color = askcolor(title='选择颜色')[0]
+    subtraction_color = askcolor(title="选择颜色")[0]
 
 
 def select_color():
     global pen_color
-    pen_color = askcolor(title='选择颜色')[0]
+    pen_color = askcolor(title="选择颜色")[0]
 
 
 def choose_save():
     global save_dir
     save_dir = tkinter.filedialog.asksaveasfilename(
-        title='选择保存位置', filetypes=[("PNG", ".png")])
+        title="选择保存位置", filetypes=[("PNG", ".png")]
+    )
     if not save_dir:
         save_dir = None
     else:
-        save_dir += '.png'
+        save_dir += ".png"
 
 
 def choose_open():
     global background_image
     background_image = tkinter.filedialog.askopenfilename(
-        title='选择载入图片', filetypes=[
-            ("PNG", ".png"), ("JPG", ".jpg")])
+        title="选择载入图片", filetypes=[("PNG", ".png"), ("JPG", ".jpg")]
+    )
     if not background_image:
         background_image = None
 
 
 def switch_brush():
     global pen_weight
-    if tkinter.messagebox.askokcancel('提示', '要切换到刷子吗(可当橡皮使用)'):
+    if tkinter.messagebox.askokcancel("提示", "要切换到刷子吗(可当橡皮使用)"):
         pen_weight = 10
 
 
 def switch_big():
     global pen_weight
-    if tkinter.messagebox.askokcancel('提示', '要切换到大笔吗'):
+    if tkinter.messagebox.askokcancel("提示", "要切换到大笔吗"):
         pen_weight = 3
 
 
 def set_pen():
     global pen_weight, pen_weight_input
-    Input = pen_weight_input.get().replace(' ', '')
+    pen = pen_weight_input.get().replace(" ", "")
     try:
-        Input = int(Input)
-        if tkinter.messagebox.askokcancel('提示', f'是否设定大小为{Input}(系统默认大小为:2)'):
-            pen_weight = Input
+        pen = int(pen)
+        if tkinter.messagebox.askokcancel("提示", f"是否设定大小为{pen}(系统默认大小为:2)"):
+            pen_weight = pen
     except BaseException:
-        if tkinter.messagebox.askokcancel('提示', '设置失败,是否要切换到中笔吗'):
+        if tkinter.messagebox.askokcancel("提示", "设置失败,是否要切换到中笔吗"):
             pen_weight = 2
 
 
 def switch_stroke():
     global pen_weight
-    if tkinter.messagebox.askokcancel('提示', '要切换到中笔吗'):
+    if tkinter.messagebox.askokcancel("提示", "要切换到中笔吗"):
         pen_weight = 2
 
 
 def switch_small():
     global pen_weight
-    if tkinter.messagebox.askokcancel('提示', '要切换到小笔吗?'):
+    if tkinter.messagebox.askokcancel("提示", "要切换到小笔吗?"):
         pen_weight = 1
 
 
 def plot_coordinate():
     global coordinate_system_drawing_method
     if tkinter.messagebox.askokcancel(
-            '提示', '是否绘制坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)'):
+        "提示", "是否绘制坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)"
+    ):
         coordinate_system_drawing_method = 1
     else:
         coordinate_system_drawing_method = None
@@ -129,7 +131,8 @@ def plot_coordinate():
 def plot_coordinate_small():
     global coordinate_system_drawing_method
     if tkinter.messagebox.askokcancel(
-            '提示', '是否绘制小跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)'):
+        "提示", "是否绘制小跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)"
+    ):
         coordinate_system_drawing_method = 2
     else:
         coordinate_system_drawing_method = None
@@ -138,7 +141,8 @@ def plot_coordinate_small():
 def plot_coordinate_big_span():
     global coordinate_system_drawing_method
     if tkinter.messagebox.askokcancel(
-            '提示', '是否绘制大跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)'):
+        "提示", "是否绘制大跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)"
+    ):
         coordinate_system_drawing_method = 3
     else:
         coordinate_system_drawing_method = None
@@ -146,12 +150,13 @@ def plot_coordinate_big_span():
 
 def set_span():
     global coordinate_system_drawing_method, span, span_Input
-    Input = span_Input.get().replace(' ', '')
+    span_input = span_Input.get().replace(" ", "")
     try:
-        Input = int(Input)
+        span_input = int(span_input)
         if tkinter.messagebox.askokcancel(
-                '提示', f'是否设定跨度为{Input}(跨度代表坐标系一个单位大小的实际像素,系统默认大跨度为:120)'):
-            span = Input
+            "提示", f"是否设定跨度为{span_input}(跨度代表坐标系一个单位大小的实际像素,系统默认大跨度为:120)"
+        ):
+            span = span_input
             coordinate_system_drawing_method = 1
         else:
             coordinate_system_drawing_method = None
@@ -159,7 +164,8 @@ def set_span():
     except BaseException:
         span = None
         if tkinter.messagebox.askokcancel(
-                '提示', '是否绘制大跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)'):
+            "提示", "是否绘制大跨度的坐标系,确定后返回草图界面任一点三点开始绘制(点击取消可撤销未执行的清空)"
+        ):
             coordinate_system_drawing_method = 3
         else:
             coordinate_system_drawing_method = None
@@ -167,8 +173,8 @@ def set_span():
 
 def empty():
     global background_color
-    if tkinter.messagebox.askokcancel('提示', '是否清空草稿(点击取消可撤销未执行的清空)'):
-        background_color = askcolor(title='选择背景颜色')[0]
+    if tkinter.messagebox.askokcancel("提示", "是否清空草稿(点击取消可撤销未执行的清空)"):
+        background_color = askcolor(title="选择背景颜色")[0]
     else:
         background_color = None
 
@@ -180,17 +186,17 @@ def open_func_box():
 
 def _help():
     global help_doc
-    tkinter.messagebox.showinfo(title='帮助', message=help_doc)
+    tkinter.messagebox.showinfo(title="帮助", message=help_doc)
 
 
 def close():  # 关闭屏幕事件
     global SCREEN
     try:
-        TK_HS.TK_DoneHS.top.destroy()
+        TK_HS.TK_DoneHS.SCREEN.destroy()
     except BaseException:
         pass
     try:
-        TK_HS.top.destroy()
+        TK_HS.SCREEN.destroy()
     except BaseException:
         pass
     SCREEN.destroy()
@@ -223,111 +229,75 @@ def tool_box():
     span = None
 
     SCREEN = tkinter.Tk()  # 设置屏幕
-    SCREEN.title('')
+    SCREEN.title("")
     SCREEN.resizable(width=False, height=False)
-    SCREEN.geometry(f'+10+10')
+    SCREEN.geometry(f"+10+10")
 
-    tkinter.Button(SCREEN, text="选择颜色", command=select_color,
-                   width=w_b, height=h_b).pack()  # 选择颜色组件
     tkinter.Button(
-        SCREEN,
-        text="选择增函数颜色",
-        command=increasing_func_color,
-        width=w_b,
-        height=1).pack()  # 选择颜色组件
+        SCREEN, text="选择颜色", command=select_color, width=w_b, height=h_b
+    ).pack()  # 选择颜色组件
     tkinter.Button(
-        SCREEN,
-        text="选择减函数颜色",
-        command=subtraction_func_color,
-        width=w_b,
-        height=1).pack()  # 选择颜色组件
+        SCREEN, text="选择增函数颜色", command=increasing_func_color, width=w_b, height=1
+    ).pack()  # 选择颜色组件
     tkinter.Button(
-        SCREEN,
-        text="使用中笔(默认笔)",
-        command=switch_stroke,
-        width=w_b,
-        height=h_b).pack()  # 切换笔
+        SCREEN, text="选择减函数颜色", command=subtraction_func_color, width=w_b, height=1
+    ).pack()  # 选择颜色组件
     tkinter.Button(
-        SCREEN,
-        text="使用大笔",
-        command=switch_big,
-        width=w_b,
-        height=1).pack()  # 切换到大笔
+        SCREEN, text="使用中笔(默认笔)", command=switch_stroke, width=w_b, height=h_b
+    ).pack()  # 切换笔
     tkinter.Button(
-        SCREEN,
-        text="使用小笔",
-        command=switch_small,
-        width=w_b,
-        height=1).pack()  # 切换笔
+        SCREEN, text="使用大笔", command=switch_big, width=w_b, height=1
+    ).pack()  # 切换到大笔
     tkinter.Button(
-        SCREEN,
-        text="使用刷子",
-        command=switch_brush,
-        width=w_b,
-        height=1).pack()  # 切换笔
+        SCREEN, text="使用小笔", command=switch_small, width=w_b, height=1
+    ).pack()  # 切换笔
+    tkinter.Button(
+        SCREEN, text="使用刷子", command=switch_brush, width=w_b, height=1
+    ).pack()  # 切换笔
     pen_weight_input = tkinter.Entry(SCREEN, width=w_b - 2)
     pen_weight_input.pack(fill=tkinter.BOTH)
     tkinter.Button(
-        SCREEN,
-        text="使用自定义大小",
-        command=set_pen,
-        width=w_b,
-        height=1).pack()  # 切换笔
+        SCREEN, text="使用自定义大小", command=set_pen, width=w_b, height=1
+    ).pack()  # 切换笔
     tkinter.Button(
-        SCREEN,
-        text="清空草稿",
-        command=empty,
-        width=w_b,
-        height=h_b).pack()  # 填充背景
+        SCREEN, text="清空草稿", command=empty, width=w_b, height=h_b
+    ).pack()  # 填充背景
     tkinter.Button(
-        SCREEN,
-        text="绘制坐标系",
-        command=plot_coordinate,
-        width=w_b,
-        height=h_b).pack()  # 绘制坐标系
+        SCREEN, text="绘制坐标系", command=plot_coordinate, width=w_b, height=h_b
+    ).pack()  # 绘制坐标系
     tkinter.Button(
-        SCREEN,
-        text="绘制坐标系(小跨度)",
-        command=plot_coordinate_small,
-        width=w_b,
-        height=1).pack()  # 绘制坐标系
+        SCREEN, text="绘制坐标系(小跨度)", command=plot_coordinate_small, width=w_b, height=1
+    ).pack()  # 绘制坐标系
     tkinter.Button(
-        SCREEN,
-        text="绘制坐标系(大跨度)",
-        command=plot_coordinate_big_span,
-        width=w_b,
-        height=1).pack()  # 绘制坐标系
+        SCREEN, text="绘制坐标系(大跨度)", command=plot_coordinate_big_span, width=w_b, height=1
+    ).pack()  # 绘制坐标系
     span_Input = tkinter.Entry(SCREEN, width=w_b - 2)
     span_Input.pack(fill=tkinter.BOTH)
     tkinter.Button(
-        SCREEN,
-        text="使用自定义跨度",
-        command=set_span,
-        width=w_b,
-        height=1).pack()  # 切换笔
-    tkinter.Button(
-        SCREEN,
-        text="绘制函数",
-        command=open_func_box,
-        width=w_b,
-        height=h_b).pack()
+        SCREEN, text="使用自定义跨度", command=set_span, width=w_b, height=1
+    ).pack()  # 切换笔
     tkinter.Button(
-        SCREEN,
-        text="保存",
-        command=choose_save,
-        width=w_b,
-        height=1).pack()
+        SCREEN, text="绘制函数", command=open_func_box, width=w_b, height=h_b
+    ).pack()
+    tkinter.Button(SCREEN, text="保存", command=choose_save, width=w_b, height=1).pack()
+    tkinter.Button(SCREEN, text="载入", command=choose_open, width=w_b, height=1).pack()
     tkinter.Button(
-        SCREEN,
-        text="载入",
-        command=choose_open,
-        width=w_b,
-        height=1).pack()
-    tkinter.Button(SCREEN, text="帮助", command=_help, width=w_b,
-                   height=1).pack()  # help是系统保留关键词,用_help代替
-    SCREEN.protocol('WM_DELETE_WINDOW', close)
+        SCREEN, text="帮助", command=_help, width=w_b, height=1
+    ).pack()  # help是系统保留关键词,用_help代替
+    SCREEN.protocol("WM_DELETE_WINDOW", close)
     SCREEN.mainloop()
-    return [pen_color, pen_weight, background_color, coordinate_system_drawing_method, func_list, save_dir, increasing_color, subtraction_color, span, background_image]
+    return [
+        pen_color,
+        pen_weight,
+        background_color,
+        coordinate_system_drawing_method,
+        func_list,
+        save_dir,
+        increasing_color,
+        subtraction_color,
+        span,
+        background_image,
+    ]
     # [0]-笔的颜色
     # [1]-笔的大小
     # [2]-背景填充

+ 32 - 35
CGB/TK_DoneHS.py

@@ -1,7 +1,8 @@
 import tkinter
 import tkinter.messagebox
 import math
-help_doc = '''
+
+help_doc = """
 请在第一个输入框输入你的函数方程,不需要输入f(x)=和y=,唯一变量是x(x为自变量)
 圆周率-Pi,自然无理数-e
 指数的表示符号:**,比如x**2表示x的二次方
@@ -11,72 +12,68 @@ help_doc = '''
 双曲函数:sinh(),cosh(),tanh()
 注意:三角函数必须带括号使用
 不支持定义域选择,不支持分段函数
-'''
+"""
 
 
 class FunctionExpression:
     def __init__(self, func):
         self.FUNC = func
         self.NAME = {
-            'x': 0,
-            'Pi': math.pi,
-            'e': math.e,
-            'log': math.log,
-            'sin': math.sin,
-            'cos': math.cos,
-            'tan': math.tan,
-            'cot': lambda x: 1 / math.tan(x),
-            'csc': lambda x: 1 / math.sin(x),
-            'sec': lambda x: 1 / math.cos(x),
-            'sinh': math.sinh,
-            'cosh': math.cosh,
-            'tanh': math.tanh,
-            'asin': math.asin,
-            'acos': math.acos,
-            'atan': math.atan}
+            "x": 0,
+            "Pi": math.pi,
+            "e": math.e,
+            "log": math.log,
+            "sin": math.sin,
+            "cos": math.cos,
+            "tan": math.tan,
+            "cot": lambda x: 1 / math.tan(x),
+            "csc": lambda x: 1 / math.sin(x),
+            "sec": lambda x: 1 / math.cos(x),
+            "sinh": math.sinh,
+            "cosh": math.cosh,
+            "tanh": math.tanh,
+            "asin": math.asin,
+            "acos": math.acos,
+            "atan": math.atan,
+        }
 
     def __call__(self, x):
-        self.NAME['x'] = x
+        self.NAME["x"] = x
         return eval(self.FUNC, self.NAME)
 
 
 def custom():
     global func_input, func, help_doc
-    Input = func_input.get().replace(' ', '')
+    Input = func_input.get().replace(" ", "")
     if Input:
         if tkinter.messagebox.askokcancel(
-                '提示', f'是否确认生成自定义函数:\n{func_input.get()}\n(点击取消可撤销未执行的制造函数)'):
+            "提示", f"是否确认生成自定义函数:\n{func_input.get()}\n(点击取消可撤销未执行的制造函数)"
+        ):
             func = FunctionExpression(func_input.get())
         else:
             func = None
     else:
-        if tkinter.messagebox.askokcancel('提示', f'点击确定撤销为执行的制造函数'):
+        if tkinter.messagebox.askokcancel("提示", f"点击确定撤销为执行的制造函数"):
             func = None
 
 
 def get_help():
-    tkinter.messagebox.showinfo(title='帮助', message=help_doc)
+    tkinter.messagebox.showinfo(title="帮助", message=help_doc)
 
 
 def make_func():
     global func_input, func, SCREEN
     func = None
     SCREEN = tkinter.Tk()  # 设置屏幕
-    SCREEN.title('')
+    SCREEN.title("")
     SCREEN.resizable(width=False, height=False)
-    SCREEN.geometry(f'+350+10')
+    SCREEN.geometry(f"+350+10")
     button = tkinter.Button(
-        SCREEN,
-        text="制造函数",
-        command=custom,
-        width=28,
-        height=1)  # 收到消息执行这个函数
+        SCREEN, text="制造函数", command=custom, width=28, height=1
+    )  # 收到消息执行这个函数
     help = tkinter.Button(
-        SCREEN,
-        text="帮助",
-        command=get_help,
-        width=28,
-        height=1)  # 帮助菜单
+        SCREEN, text="帮助", command=get_help, width=28, height=1
+    )  # 帮助菜单
     func_input = tkinter.Entry(SCREEN)
     func_input.pack(fill=tkinter.BOTH)
     button.pack()

+ 58 - 137
CGB/TK_HS.py

@@ -5,7 +5,7 @@ from CGB import TK_DoneHS
 
 def linear_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制1次函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制1次函数(点击取消可撤销未执行的函数)"):
         func_dict[1] = lambda x: x
     else:
         func_dict[1] = None
@@ -13,7 +13,7 @@ def linear_func():
 
 def quadratic_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制2次函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制2次函数(点击取消可撤销未执行的函数)"):
         func_dict[2] = lambda x: x ** 2
     else:
         func_dict[2] = None
@@ -21,7 +21,7 @@ def quadratic_func():
 
 def cubic_function():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制3次函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制3次函数(点击取消可撤销未执行的函数)"):
         func_dict[4] = lambda x: x ** 3
     else:
         func_dict[4] = None
@@ -29,7 +29,7 @@ def cubic_function():
 
 def inverse_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制-1次函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制-1次函数(点击取消可撤销未执行的函数)"):
         func_dict[3] = lambda x: 1 / x
     else:
         func_dict[3] = None
@@ -37,7 +37,7 @@ def inverse_func():
 
 def radical_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制根号函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制根号函数(点击取消可撤销未执行的函数)"):
         func_dict[5] = lambda x: x ** (1 / 2)
     else:
         func_dict[5] = None
@@ -45,7 +45,7 @@ def radical_func():
 
 def exp_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制指数函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制指数函数(点击取消可撤销未执行的函数)"):
         func_dict[6] = lambda x: 10 ** x
     else:
         func_dict[6] = None
@@ -53,7 +53,7 @@ def exp_func():
 
 def log_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制对数函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制对数函数(点击取消可撤销未执行的函数)"):
         func_dict[7] = lambda x: math.log(x, 2)
     else:
         func_dict[7] = None
@@ -61,7 +61,7 @@ def log_func():
 
 def log2_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制对数函数2(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制对数函数2(点击取消可撤销未执行的函数)"):
         func_dict[8] = lambda x: math.log(2, x)
     else:
         func_dict[8] = None
@@ -69,7 +69,7 @@ def log2_func():
 
 def sin_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制正弦函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制正弦函数(点击取消可撤销未执行的函数)"):
         func_dict[9] = lambda x: math.sin(x)
     else:
         func_dict[9] = None
@@ -77,7 +77,7 @@ def sin_func():
 
 def cos_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制余弦函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制余弦函数(点击取消可撤销未执行的函数)"):
         func_dict[10] = lambda x: math.cos(x)
     else:
         func_dict[10] = None
@@ -85,7 +85,7 @@ def cos_func():
 
 def tan_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制正切函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制正切函数(点击取消可撤销未执行的函数)"):
         func_dict[11] = lambda x: math.tan(x)
     else:
         func_dict[11] = None
@@ -93,7 +93,7 @@ def tan_func():
 
 def cot_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制余切函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制余切函数(点击取消可撤销未执行的函数)"):
         func_dict[12] = lambda x: 1 / math.tan(x)
     else:
         func_dict[12] = None
@@ -101,7 +101,7 @@ def cot_func():
 
 def sec_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制正割函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制正割函数(点击取消可撤销未执行的函数)"):
         func_dict[13] = lambda x: 1 / math.cos(x)
     else:
         func_dict[13] = None
@@ -109,7 +109,7 @@ def sec_func():
 
 def csc_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制余割函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制余割函数(点击取消可撤销未执行的函数)"):
         func_dict[11] = lambda x: 1 / math.sin(x)
     else:
         func_dict[11] = None
@@ -117,7 +117,7 @@ def csc_func():
 
 def arcsin_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反正弦函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反正弦函数(点击取消可撤销未执行的函数)"):
         func_dict[12] = lambda x: math.asin(x)
     else:
         func_dict[12] = None
@@ -125,7 +125,7 @@ def arcsin_func():
 
 def arccos_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反余弦函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反余弦函数(点击取消可撤销未执行的函数)"):
         func_dict[13] = lambda x: math.acos(x)
     else:
         func_dict[13] = None
@@ -133,7 +133,7 @@ def arccos_func():
 
 def arctan_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反正切函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反正切函数(点击取消可撤销未执行的函数)"):
         func_dict[14] = lambda x: math.atan(x)
     else:
         func_dict[14] = None
@@ -141,7 +141,7 @@ def arctan_func():
 
 def arccot_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反余切函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反余切函数(点击取消可撤销未执行的函数)"):
         func_dict[15] = lambda x: 1 / math.atan(x)
     else:
         func_dict[15] = None
@@ -149,7 +149,7 @@ def arccot_func():
 
 def arcsec_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反正割函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反正割函数(点击取消可撤销未执行的函数)"):
         func_dict[16] = lambda x: 1 / math.acos(x)
     else:
         func_dict[16] = None
@@ -157,7 +157,7 @@ def arcsec_func():
 
 def arccsc_func():
     global func_dict
-    if tkinter.messagebox.askokcancel('提示', '是否绘制反余割函数(点击取消可撤销未执行的函数)'):
+    if tkinter.messagebox.askokcancel("提示", "是否绘制反余割函数(点击取消可撤销未执行的函数)"):
         func_dict[17] = lambda x: 1 / math.asin(x)
     else:
         func_dict[17] = None
@@ -174,7 +174,7 @@ def custom_func():
 def close():
     global SCREEN
     try:
-        TK_DoneHS.top.destroy()
+        TK_DoneHS.SCREEN.destroy()
     except BaseException:
         pass
     SCREEN.destroy()
@@ -188,135 +188,56 @@ def func_box():
     width = 20
 
     SCREEN = tkinter.Tk()  # 设置屏幕
-    SCREEN.title('')
+    SCREEN.title("")
     SCREEN.resizable(width=False, height=False)
-    SCREEN.geometry(f'+180+10')
+    SCREEN.geometry(f"+180+10")
     tkinter.Button(
-        SCREEN,
-        text="1次函数",
-        command=linear_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="1次函数", command=linear_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="2次函数",
-        command=quadratic_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="2次函数", command=quadratic_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="-1次函数",
-        command=inverse_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="-1次函数", command=inverse_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="3次函数",
-        command=cubic_function,
-        width=width,
-        height=1).pack()
+        SCREEN, text="3次函数", command=cubic_function, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="根号函数",
-        command=radical_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="根号函数", command=radical_func, width=width, height=1
+    ).pack()
+    tkinter.Button(SCREEN, text="对数函数", command=log_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="指数函数", command=exp_func, width=width, height=1).pack()
     tkinter.Button(
-        SCREEN,
-        text="对数函数",
-        command=log_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="对数底函数", command=log2_func, width=width, height=1
+    ).pack()
+    tkinter.Button(SCREEN, text="sin函数", command=sin_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="cos函数", command=cos_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="tan函数", command=tan_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="cot函数", command=tan_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="csc函数", command=csc_func, width=width, height=1).pack()
+    tkinter.Button(SCREEN, text="sec函数", command=sec_func, width=width, height=1).pack()
     tkinter.Button(
-        SCREEN,
-        text="指数函数",
-        command=exp_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arcsin函数", command=arcsin_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="对数底函数",
-        command=log2_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arccos函数", command=arccos_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="sin函数",
-        command=sin_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arctan函数", command=arctan_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="cos函数",
-        command=cos_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arccot函数", command=arccot_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="tan函数",
-        command=tan_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arccsc函数", command=arccsc_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="cot函数",
-        command=tan_func,
-        width=width,
-        height=1).pack()
+        SCREEN, text="arcsec函数", command=arcsec_func, width=width, height=1
+    ).pack()
     tkinter.Button(
-        SCREEN,
-        text="csc函数",
-        command=csc_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="sec函数",
-        command=sec_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arcsin函数",
-        command=arcsin_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arccos函数",
-        command=arccos_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arctan函数",
-        command=arctan_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arccot函数",
-        command=arccot_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arccsc函数",
-        command=arccsc_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="arcsec函数",
-        command=arcsec_func,
-        width=width,
-        height=1).pack()
-    tkinter.Button(
-        SCREEN,
-        text="自定义函数",
-        command=custom_func,
-        width=width,
-        height=3).pack()
-    SCREEN.protocol('WM_DELETE_WINDOW', close)
+        SCREEN, text="自定义函数", command=custom_func, width=width, height=3
+    ).pack()
+    SCREEN.protocol("WM_DELETE_WINDOW", close)
     SCREEN.mainloop()
     return func_dict

+ 7 - 4
CGB/Write.py

@@ -42,7 +42,8 @@ mode = {1: '绘制坐标系', 2: '绘制直线(g)', 3: '填充矩形(f)', 4: '
 
 
 def func_draw(func_list, pixel_accuracy=1000):
-    global horizontal_pixels, horizontal_scale, ordinate_pixels, ordinate_scale, anchor_y, anchor_x, pen_color, increasing_color, subtraction_color
+    global horizontal_pixels, horizontal_scale, ordinate_pixels, ordinate_scale, anchor_y, anchor_x, pen_color
+    global increasing_color, subtraction_color
     c = [0, 0, 0]  # 增函数颜色
 
     def x_convert_pixels(x_coordinate):
@@ -222,7 +223,8 @@ def top_draw():
         point = f'主色调:{pen_color} 增函数颜色:{increasing_color} 减函数颜色:{subtraction_color}'
     mouse_tip = FONT.render(f'鼠标:{bottom_tip[0]},{bottom_tip[1]}', True, (0, 0, 0))
     status_tip = FONT.render(
-        f'{bottom_tip[2]},{bottom_tip[3]},{bottom_tip[4]} ; 大小:{pen_weight} ; 原点:{record_origin_x},{record_origin_y}'
+        f'{bottom_tip[2]},{bottom_tip[3]},{bottom_tip[4]} ; 大小:{pen_weight} ; '
+        f'原点:{record_origin_x},{record_origin_y}'
         f' ; 跨度:{span} ; {point}',
         True,
         (0,
@@ -234,9 +236,10 @@ def top_draw():
 
 
 def draw_main(dis_x=900, dis_y=700):
-    global previous_x, previous_y, pen_color, pen_weight, background, coordinate_system_drawing_method, coordinate_click_point, record_origin_x
+    global previous_x, previous_y, pen_color, pen_weight, background, coordinate_system_drawing_method
+    global coordinate_click_point, record_origin_x
     global record_origin_y, span, line
-    global continuous_draw, middle_key, rect, poly, SCREEN, SCREEN_CAPTION, init_done, previous_x, previous_y, save_dir  # 定义全局变量
+    global continuous_draw, middle_key, rect, poly, SCREEN, SCREEN_CAPTION, init_done, previous_x, previous_y, save_dir
     global increasing_color, subtraction_color, bottom_tip, FONT, SCREEN_X, SCREEN_Y, tips, FONT
     SCREEN_X = dis_x
     SCREEN_Y = dis_y

Diff do ficheiro suprimidas por serem muito extensas
+ 312 - 251
Crawler/Crawler_controller.py


+ 14 - 12
Crawler/Information_storage.py

@@ -4,8 +4,8 @@ import time
 
 class Database:
     def __init__(self, name):
-        self.dir = rf'{os.getcwd()}/Database_dir/{name}.cotanDB'  # 创建DB文件
-        self.file = open(self.dir, 'r+' if os.path.exists(self.dir) else 'w+')
+        self.dir = rf"{os.getcwd()}/Database_dir/{name}.cotanDB"  # 创建DB文件
+        self.file = open(self.dir, "r+" if os.path.exists(self.dir) else "w+")
         self.id = 0
         self.name = name
         for _ in self.file.readlines():
@@ -23,8 +23,8 @@ class Database:
     def add_new(self, data):
         data_str = str(self.id)
         for i in data:
-            data_str += ',' + str(i)
-        data_str += '\n'
+            data_str += "," + str(i)
+        data_str += "\n"
         self.file.write(data_str)
         self.file.flush()
         self.id += 1
@@ -34,7 +34,7 @@ class Database:
         os.remove(self.dir)
 
     def out_file(self, out_dir):
-        with open(out_dir + fr'/{self.name}.contanDB', 'w') as f:
+        with open(out_dir + fr"/{self.name}.contanDB", "w") as f:
             with open(self.dir) as g:
                 f.write(g.read())
 
@@ -76,18 +76,20 @@ class DatabaseController:  # data base控制器
         return list(self.database.keys())
 
 
-class log:
+class Log:
     def __init__(self, log_dir):
         self.log_dir = log_dir
-        self.log_file = open(log_dir +
-                             '/log.coTanLog', 'r+' if os.path.exists(log_dir +
-                                                                     'log.coTanLog') else 'w+')
+        self.log_file = open(
+            log_dir + "/log.coTanLog",
+            "r+" if os.path.exists(log_dir + "log.coTanLog") else "w+",
+        )
 
     def write(self, data):
         self.log_file.write(
-            f"[{time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))}] " +
-            data +
-            '\n')
+            f"[{time.strftime('%Y-%m-%d %H:%M:%S',time.localtime(time.time()))}] "
+            + data
+            + "\n"
+        )
         self.log_file.flush()
 
     def close(self):

Diff do ficheiro suprimidas por serem muito extensas
+ 318 - 595
Crawler/Web_Crawler.py


+ 1 - 1
Crawler/__init__.py

@@ -1,2 +1,2 @@
-from Crawler.Web_Crawler import Main
+from Crawler.Web_Crawler import crawler_main
 print('自动化网页加载完成')

+ 167 - 149
DSGC/Algebra.py

@@ -4,7 +4,7 @@ from sympy.plotting import plot3d, plot
 
 class AlgebraBase:
     def __init__(self, new=lambda x: x):
-        self.symbol_dict = {'self': self}  # 命名空间
+        self.symbol_dict = {"self": self}  # 命名空间
         self.symbol_dict.update(globals())
         self.symbol_dict.update(locals())
         self.algebra_dict = {}
@@ -17,76 +17,71 @@ class AlgebraBase:
         try:
             name = f.func.__name__
             args = f.args
-            if name == 'Pow':
+            if name == "Pow":
                 try:
                     if args[1] < 0:
-                        a = [['A', '1']]
+                        a = [["A", "1"]]
                         b = self.formula_export(f.func(args[0], -args[1]))
-                        result_str.append(['D', a, b])
+                        result_str.append(["D", a, b])
                     else:
                         raise Exception
                 except BaseException:
                     a = self.formula_export(args[0])
                     b = self.formula_export(args[1])
-                    result_str.append(['B', a, b])
-            elif name == 'log':
+                    result_str.append(["B", a, b])
+            elif name == "log":
                 b = self.formula_export(args[0])
-                result_str.append(['C', [['A', 'ln ']], b])
-            elif name == 'Add':
+                result_str.append(["C", [["A", "ln "]], b])
+            elif name == "Add":
                 a = 0
                 for i in args:
                     get = self.formula_export(i)
                     if a != 0:
-                        result_str.append(['A', ' + '])
+                        result_str.append(["A", " + "])
                     result_str += get
                     a += 1
-            elif name == 'Mul':
+            elif name == "Mul":
                 a = 0
                 for i in args:
                     get = self.formula_export(i)
                     if a != 0:
-                        result_str.append(['A', ' × '])
+                        result_str.append(["A", " × "])
                     result_str += get
                     a += 1
-            elif name == 'Rational':
-                q = str(f).split('/')
-                a = [['A', q[0]]]
-                b = [['A', q[1]]]
-                result_str.append(['D', a, b])
+            elif name == "Rational":
+                q = str(f).split("/")
+                a = [["A", q[0]]]
+                b = [["A", q[1]]]
+                result_str.append(["D", a, b])
             elif len(args) < 1:
                 raise Exception
             else:  # 增添逗号
-                result_str.append(['A', f'{str(name)}( '])
+                result_str.append(["A", f"{str(name)}( "])
                 a = 0
                 for i in args:
                     get = self.formula_export(i)
                     if a != 0:
-                        result_str.append(['A', ' , '])
+                        result_str.append(["A", " , "])
                     result_str += get
                     a += 1
-                result_str.append(['A', ' )'])
+                result_str.append(["A", " )"])
             return result_str
         except BaseException:
             a = str(f)
             try:
-                if a[0] == '-':
-                    a = f'({a})'
+                if a[0] == "-":
+                    a = f"({a})"
             except BaseException:
                 pass
-            result_str.append(['A', a])
+            result_str.append(["A", a])
             return result_str
 
     def simplify(self, alg, radio=1.7, func=None, rat=True, inv=False):  # 函数简化
         if func is None:
             func = count_ops
         try:
-            self.out_status('正在标准化')
-            return simplify(
-                alg,
-                ratio=radio,
-                func=func,
-                rational=rat,
-                inverse=inv)
+            self.out_status("正在标准化")
+            return simplify(alg, ratio=radio, func=func, rational=rat, inverse=inv)
         except BaseException:
             return None
 
@@ -95,49 +90,50 @@ class AlgebraBase:
         return self.print_expression_core(e, level, first)
 
     def print_expression_core(self, e, level=0, first=True, q=1):  # 递归
-        str_print = ' ' * level
+        str_print = " " * level
         if first:
-            str_print = f'[{e}]\n' + str_print
+            str_print = f"[{e}]\n" + str_print
         try:
             name = e.func.__name__
             args = e.args
             if args == ():
                 raise Exception
-            if name == 'log':
-                name = 'ln'
-            str_print += f'({q}){name}\n'
+            if name == "log":
+                name = "ln"
+            str_print += f"({q}){name}\n"
             n = len(name)
             for i in args:
-                self.out_status('正在迭代运算中')
+                self.out_status("正在迭代运算中")
                 str_print += self.print_expression_core(
-                    i, level + n, first=False, q=q + 1)
+                    i, level + n, first=False, q=q + 1
+                )
             return str_print
         except BaseException:
-            return str_print + f'({q}){str(e)}\n'
+            return str_print + f"({q}){str(e)}\n"
 
-    def split_func_core(self, e, deep, f, first=True):  # 递归
+    def split_func_core(self, exp, deep, name_list, first=True):  # 递归
         try:
-            name = e.func.__name__
-            args = e.args
-            if name not in f or args == ():
-                if f != ['All']:
+            name = exp.func.__name__
+            args = exp.args
+            if name not in name_list or args == ():
+                if name_list != ["All"]:
                     raise Exception
                 else:
                     deep = 1
             if deep == 1:
-                if f == ['All'] and not first:
-                    re = [e]
+                if name_list == ["All"] and not first:
+                    re = [exp]
                 else:
                     re = []
                 for i in args:
-                    self.out_status('正在迭代运算中')
-                    get = self.split_func_core(i, deep, f, False)
+                    self.out_status("正在迭代运算中")
+                    get = self.split_func_core(i, deep, name_list, False)
                     re += get
                 return re
             else:
                 return args
         except BaseException:
-            return [e]
+            return [exp]
 
     def merge_func_core(self, name_list, func):
         if len(name_list) < 2:
@@ -154,7 +150,7 @@ class AlgebraBase:
             elif num_type == 1:  # 整数
                 return Integer(num)
             elif num_type == 2:  # 有理数
-                n = num.split('/')
+                n = num.split("/")
                 return Rational(n[0], n[1])
             else:
                 return sympify(num, locals=self.symbol_dict)
@@ -168,50 +164,62 @@ class AlgebraPolynomial(AlgebraBase):
         alg = []
         for name in self.algebra_dict:
             alg.append(name)
-            alg_view.append(f'{name} --> {self.algebra_dict[name]}')
+            alg_view.append(f"{name} --> {self.algebra_dict[name]}")
         value = []
         value_view = []
         for name in self.symbol_describe:
             value.append(name)
-            value_view.append(f'符号:{name} --> {self.symbol_describe[name]}')
+            value_view.append(f"符号:{name} --> {self.symbol_describe[name]}")
         return (value_view, value), (alg_view, alg)
 
     def del_symbol(self, x):
         del self.symbol_describe[x]
         del self.symbol_dict[x]
 
-    def add_symbol(self, name, is_generation=0, is_rational=0, is_prime=0, is_even=0, is_finite=0, is_complex=None,
-                   is_natural=None, is_integer=0, no_constraint=0, describe='自定义符号'):
+    def add_symbol(
+        self,
+        name,
+        is_generation=0,
+        is_rational=0,
+        is_prime=0,
+        is_even=0,
+        is_finite=0,
+        is_complex=None,
+        is_natural=None,
+        is_integer=0,
+        no_constraint=0,
+        describe="自定义符号",
+    ):
         k = {}
         try:
-            name = name.replace(' ', '')
-            exec(f'{name} = 5', {})  # 测试name有没有做符号名字的资质
+            name = name.replace(" ", "")
+            exec(f"{name} = 5", {})  # 测试name有没有做符号名字的资质
             if no_constraint == 1:
                 raise Exception
             if is_generation == 1:  # 代数
-                k['algebraic'] = True
+                k["algebraic"] = True
             elif is_generation == 2:  # 超越数
-                k['transcendental'] = True
+                k["transcendental"] = True
             if is_rational == 1:  # 有理数
-                k['rational'] = True
+                k["rational"] = True
             elif is_rational == 2:  # 无理数
-                k['irrational'] = True
+                k["irrational"] = True
             if is_prime == 1:  # 质数
-                k['prime'] = True
+                k["prime"] = True
             elif is_prime == 2:  # 合数
-                k['composite'] = True
+                k["composite"] = True
             if is_even == 1:  # 偶数
-                k['even'] = True
+                k["even"] = True
             elif is_even == 2:  # 奇数
-                k['odd'] = True
+                k["odd"] = True
             if is_finite == 1:  # 有限实数
-                k['finite'] = True
+                k["finite"] = True
             elif is_finite == 2:  # 无穷
-                k['infinite'] = True
+                k["infinite"] = True
             elif is_finite == 3:  # 广义实数
-                k['extended_real'] = True
+                k["extended_real"] = True
             if is_integer == 1:
-                k['integer'] = True
+                k["integer"] = True
             try:  # 避免CIR不是list而是None
                 k[is_complex[0]] = is_complex[1]
             except BaseException:
@@ -223,11 +231,9 @@ class AlgebraPolynomial(AlgebraBase):
         except BaseException:
             pass
         new_name = self.symbol_dict.copy()
-        new_name.update({'k': k})
+        new_name.update({"k": k})
         try:
-            exec(
-                f"self.Name['{name}'] = Symbol('{name}',**k)",
-                new_name)  # 创建一个Symbols
+            exec(f"self.Name['{name}'] = Symbol('{name}',**k)", new_name)  # 创建一个Symbols
             self.symbol_describe[name] = describe
             return True
         except BaseException:
@@ -241,19 +247,19 @@ class AlgebraPolynomial(AlgebraBase):
         no_prediction = []  # 不成立的预测
         for i in get:
             if get[i]:
-                establish_forecast.append(f'{interpreter(i)} >>> {get[i]}')
+                establish_forecast.append(f"{interpreter(i)} >>> {get[i]}")
             else:
-                no_prediction.append(f'{interpreter(i)} >>> {get[i]}')
+                no_prediction.append(f"{interpreter(i)} >>> {get[i]}")
         return establish_forecast + no_prediction
 
     def add_expression(self, name, alg):  # 添加表达式
         try:
-            name = name.replace(' ', '')
+            name = name.replace(" ", "")
             try:
-                exec(f'{name}=5', {})  # 检查name是否符合标准
+                exec(f"{name}=5", {})  # 检查name是否符合标准
             except BaseException:
-                name = f'F{str(len(self.algebra_dict))}'
-            eval(f'{alg}', self.symbol_dict)  # 检查
+                name = f"F{str(len(self.algebra_dict))}"
+            eval(f"{alg}", self.symbol_dict)  # 检查
             self.algebra_dict[name] = sympify(alg, locals=self.symbol_dict)
             self.algebra_dict_view[name] = str(alg)
             return True
@@ -274,8 +280,8 @@ class AlgebraPolynomial(AlgebraBase):
         else:
             return self.algebra_dict[name]
 
-    def print_expression(self, name, level=0, First=True):  # 根据名字打印
-        return self.print_expression_core(self.get_expression(name), level, First)
+    def print_expression(self, name, level=0, first=True):  # 根据名字打印
+        return self.print_expression_core(self.get_expression(name), level, first)
 
     def split_mul(self, name, return_num=False, return_one=False):
         exp = self.get_expression(name)
@@ -305,20 +311,20 @@ class AlgebraPolynomial(AlgebraBase):
         exp = self.get_expression(name)
         exp = expand(exp)
         coll = collect(exp, collect_exp)
-        coll_Dic = collect(exp, collect_exp, evaluate=False)
+        coll_dict = collect(exp, collect_exp, evaluate=False)
         if return_type == 0:
-            return list(coll_Dic.keys()), coll
+            return list(coll_dict.keys()), coll
         elif return_type == 1:
-            return list(coll_Dic.values()), coll
+            return list(coll_dict.values()), coll
         else:
             re = []
-            for i in coll_Dic:
-                re.append(i * coll_Dic[i])
+            for i in coll_dict:
+                re.append(i * coll_dict[i])
             return re, coll
 
     def split_func(self, name, deep, func_name, return_all=True):
         alg = self.get_expression(name)
-        if func_name == ['']:
+        if func_name == [""]:
             try:
                 return alg.args, alg
             except BaseException:
@@ -380,7 +386,9 @@ class AlgebraPolynomial(AlgebraBase):
         alg = self.get_expression(name)
         return together(alg, deep)
 
-    def fractional_rat(self, name, rationalized_unknown, maximum_irrational_term):  # 分母有理化
+    def fractional_rat(
+        self, name, rationalized_unknown, maximum_irrational_term
+    ):  # 分母有理化
         alg = self.get_expression(name)
         return radsimp(alg, rationalized_unknown, maximum_irrational_term)
 
@@ -405,12 +413,12 @@ class AlgebraPolynomial(AlgebraBase):
         return powdenest(alg)
 
     def pow_simp_base(self, name, keep_assumptions):  # 处理底数
-        return self.pow_simp_core(name, keep_assumptions, 'base')
+        return self.pow_simp_core(name, keep_assumptions, "base")
 
     def pow_simp_exp(self, name, keep_assumptions):  # 处理指数
-        return self.pow_simp_core(name, keep_assumptions, 'exp')
+        return self.pow_simp_core(name, keep_assumptions, "exp")
 
-    def pow_simp_core(self, name, keep_assumptions, combine='all'):  # 均处理
+    def pow_simp_core(self, name, keep_assumptions, combine="all"):  # 均处理
         alg = self.get_expression(name)
         return powsimp(alg, force=keep_assumptions, combine=combine)
 
@@ -424,9 +432,16 @@ class AlgebraPolynomial(AlgebraBase):
 
     def pow_expansion_core(self, name, deep):
         alg = self.get_expression(name)
-        return expand(alg, deep=deep, log=False, mul=False,
-                      power_exp=True, power_base=True, multinomial=True,
-                      basic=False)
+        return expand(
+            alg,
+            deep=deep,
+            log=False,
+            mul=False,
+            power_exp=True,
+            power_base=True,
+            multinomial=True,
+            basic=False,
+        )
 
     def log_simp(self, name, keep_assumptions):
         alg = self.get_expression(name)
@@ -447,9 +462,9 @@ class AlgebraPolynomial(AlgebraBase):
     def factor(self, name, modulus, is_gaussian, deep, rat):
         k = {}
         if modulus is not None:
-            k['modulus'] = modulus
+            k["modulus"] = modulus
         if is_gaussian:
-            k['gaussian'] = True
+            k["gaussian"] = True
         alg = self.get_expression(name)
         return factor(alg, deep=deep, fraction=rat, **k)
 
@@ -474,38 +489,38 @@ class AlgebraPolynomial(AlgebraBase):
 
     def value_algebraic_simultaneous(self, name, simultaneous_dict):
         alg = self.get_expression(name)
-        sympy_Dic = {}
+        sympy_dict = {}
         for i in simultaneous_dict:  # i是符号,Dic[i]是代数式名字
             try:
                 v_alg = self.get_expression(simultaneous_dict[i])  # 获得代数式
                 get = self.symbol_dict[i]  # 处理符号
-                sympy_Dic[get] = v_alg
+                sympy_dict[get] = v_alg
             except BaseException:
                 pass
-        return alg.subs(sympy_Dic)
+        return alg.subs(sympy_dict)
 
     def algebragic_value_simultaneous(self, name, simultaneous_dict):
         alg = self.get_expression(name)
-        sympy_Dic = {}
+        sympy_dict = {}
         for i in simultaneous_dict:  # i是代数式名字,Dic[i]是符号
             try:
                 v_alg = self.get_expression(i)  # 获得代数式
                 get = self.symbol_dict[simultaneous_dict[i]]  # 处理符号
-                sympy_Dic[v_alg] = get
+                sympy_dict[v_alg] = get
             except BaseException:
                 pass
-        return alg.subs(sympy_Dic)
+        return alg.subs(sympy_dict)
 
     def algebraic_assignment(self, name, simultaneous_dict):
         alg = self.get_expression(name)
-        sympy_Dic = {}
+        sympy_dict = {}
         for i in simultaneous_dict:  # i是符号,Dic[i]是数字
             try:
                 get = self.symbol_dict[i]  # 处理符号
-                sympy_Dic[get] = simultaneous_dict[i]
+                sympy_dict[get] = simultaneous_dict[i]
             except BaseException:
                 pass
-        return alg.subs(sympy_Dic)
+        return alg.subs(sympy_dict)
 
     def solving_equations(self, equation_set):
         alg = []
@@ -525,17 +540,16 @@ class AlgebraPolynomial(AlgebraBase):
         return result
 
     def solving_inequality(self, inequalities, inequality_symbol):
-        inequality_symbol = ['>', '<', '>=', '<='][inequality_symbol]
+        inequality_symbol = [">", "<", ">=", "<="][inequality_symbol]
         z = self.get_expression(inequalities[0])
         y = self.get_expression(inequalities[1])
-        f = sympify(f'{z} {inequality_symbol} {y}', locals=self.symbol_dict)
-        print(f)
+        f = sympify(f"{z} {inequality_symbol} {y}", locals=self.symbol_dict)
         answer = solve(f)
-        if answer:
-            return ['恒成立']
-        elif answer == False:
-            return ['恒不成立']
-        get = self.split_func_core(answer, 1, ('Or'))
+        if answer is true:
+            return ["恒成立"]
+        elif answer is false:
+            return ["恒不成立"]
+        get = self.split_func_core(answer, 1, ["Or"])
         return get
 
     def rewrite_exp(self, name, rewrite_func, rewrite_object, deep=False):
@@ -554,66 +568,70 @@ class AlgebraPolynomial(AlgebraBase):
         alg = self.get_expression(name)
         list_2d[0] = self.symbol_dict[list_2d[0]]
         if list_3d is None:
-            self.out_status('正在绘制图像')
+            self.out_status("正在绘制图像")
             plot(
                 alg,
                 tuple(list_2d),
-                xlabel=f'{list_2d[0]}',
-                ylabel=f'{alg}',
-                title='CoTan Algebra')
+                xlabel=f"{list_2d[0]}",
+                ylabel=f"{alg}",
+                title="CoTan Algebra",
+            )
         else:
             list_3d = list_3d.copy()
             list_3d[0] = self.symbol_dict[list_3d[0]]
-            self.out_status('正在绘制图像')
+            self.out_status("正在绘制图像")
             plot3d(
                 alg,
                 tuple(list_2d),
                 tuple(list_3d),
-                xlabel=f'{list_2d[0]}',
-                ylabel=f'{list_3d[0]}',
-                zlable=f'{alg}',
-                title='CoTan Algebra')
+                xlabel=f"{list_2d[0]}",
+                ylabel=f"{list_3d[0]}",
+                zlable=f"{alg}",
+                title="CoTan Algebra",
+            )
 
     def get_expression_from_name(self, name):
         alg = self.get_expression(name)
         return self.formula_export(alg)
 
+
 # 提供翻译服务
 
 
 def interpreter(word: str):
     book = {
-        'algebraic': '代数',
-        'transcendental': '超越数',
-        'rational': '有理数',
-        'irrational': '无理数',
-        'odd': '奇数',
-        'even': '偶数',
-        'negative': '负数',
-        'positive': '正数',
-        'zero': '零',
-        'complex': '复数',
-        'imaginary': '虚数',
-        'real': '实数',
-        'integer': '整数',
-        'prime': '质数',
-        'composite': '合数',
-        'finite': '有限数字',
-        'infinite': '无穷',
-        'extended_real': '广义实数',
-        'commutative': '满足交换律',
-        'hermitian': '厄米特矩阵',
-        'nonnegative': '非负数',
-        'nonpositive': '非正数',
-        'nonzero': '非零实数',
-        'noninteger': '非整数',
-        'extended_nonzero': '广义非零数',
-        'extended_negative': '广义负数',
-        'extended_nonpositive': '广义非正数',
-        'extended_nonnegative': '广义非负数',
-        'extended_positive': '广义正数'}
+        "algebraic": "代数",
+        "transcendental": "超越数",
+        "rational": "有理数",
+        "irrational": "无理数",
+        "odd": "奇数",
+        "even": "偶数",
+        "negative": "负数",
+        "positive": "正数",
+        "zero": "零",
+        "complex": "复数",
+        "imaginary": "虚数",
+        "real": "实数",
+        "integer": "整数",
+        "prime": "质数",
+        "composite": "合数",
+        "finite": "有限数字",
+        "infinite": "无穷",
+        "extended_real": "广义实数",
+        "commutative": "满足交换律",
+        "hermitian": "厄米特矩阵",
+        "nonnegative": "非负数",
+        "nonpositive": "非正数",
+        "nonzero": "非零实数",
+        "noninteger": "非整数",
+        "extended_nonzero": "广义非零数",
+        "extended_negative": "广义负数",
+        "extended_nonpositive": "广义非正数",
+        "extended_nonnegative": "广义非负数",
+        "extended_positive": "广义正数",
+    }
     try:
         results = book[word]
-        return f'{results}({word})'
+        return f"{results}({word})"
     except BaseException:
         return word

Diff do ficheiro suprimidas por serem muito extensas
+ 337 - 230
DSGC/Algebra_Systemctl.py


Diff do ficheiro suprimidas por serem muito extensas
+ 302 - 312
Data_Science/Learn.py


Diff do ficheiro suprimidas por serem muito extensas
+ 246 - 346
Data_Science/Me_learn.py


Diff do ficheiro suprimidas por serem muito extensas
+ 315 - 513
Git_controller/GIT.py


+ 243 - 192
Git_controller/GitController.py

@@ -11,27 +11,29 @@ sys_seeting = dict(
     stdin=subprocess.PIPE,
     stdout=subprocess.PIPE,
     stderr=subprocess.STDOUT,
-    universal_newlines=True)
-git_path = 'git'  # git的地址,如果配置了环境变量则不需要修改
-stop_key = '【操作完成】'  # 存储stopKey的global变量
-passwd = '1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM'  # stopKey的候选词库
+    universal_newlines=True,
+)
+git_path = "git"  # git的地址,如果配置了环境变量则不需要修改
+stop_key = "【操作完成】"  # 存储stopKey的global变量
+passwd = (
+    "1234567890qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM"  # stopKey的候选词库
+)
 
 
 class GitRepo:  # git的基类
     def __init__(self, repo_dir, *args, **kwargs):
         self.url = None
         try:
-            if exists(repo_dir + r'/.git'):  # 是否为git 仓库
+            if exists(repo_dir + r"/.git"):  # 是否为git 仓库
                 pass
-            elif repo_dir[-4:] == '.git':
+            elif repo_dir[-4:] == ".git":
                 repo_dir = repo_dir[:-5]  # -5,得把/去掉
             else:
                 raise Exception
         except BaseException:
             subprocess.Popen(
-                f'{git_path} init',
-                cwd=self.repo_dir,
-                **sys_seeting).wait()
+                f"{git_path} init", cwd=self.repo_dir, **sys_seeting
+            ).wait()
         self.repo_dir = repo_dir  # 仓库地址(末尾不带/)
         self.repo = Repo(repo_dir)  # 读取一个仓库
         self.name = split(repo_dir)[-1]
@@ -39,20 +41,20 @@ class GitRepo:  # git的基类
 
     def make_stop_key(self):  # 生成一个随机stopKey
         global stop_key, passwd
-        code = ''
+        code = ""
         for _ in range(8):  # 八位随机数
             code += passwd[random.randint(0, len(passwd) - 1)]  # 时间戳+8位随机数
-        stop_key = (str(time()) + code).replace('.', '')
+        stop_key = (str(time()) + code).replace(".", "")
         return stop_key
 
-    def get_flie_list(self, file_list, is_file=True, pat=' '):
-        if file_list == '.':
-            file = '..'
+    def get_flie_list(self, file_list, is_file=True, pat=" "):
+        if file_list == ".":
+            file = ".."
         else:
             file_ = []
             for i in file_list:
-                if i[:len(self.repo_dir)] == self.repo_dir:
-                    file_.append(i[len(self.repo_dir) + 1:])  # +1是为了去除/
+                if i[: len(self.repo_dir)] == self.repo_dir:
+                    file_.append(i[len(self.repo_dir) + 1 :])  # +1是为了去除/
             if not is_file:
                 return file_
             file = pat.join(file_)
@@ -62,304 +64,338 @@ class GitRepo:  # git的基类
         listfile = []
         if all:
             listfile += [
-                f'[当前分支] {self.repo.active_branch} 工作区{"不" if self.repo.is_dirty() else ""}干净 -> {self.name}']
-        listfile += [f'{"[配置文件]" if i == ".git" else "[未跟踪]"if i in self.repo.untracked_files else "[已跟踪]"} {i}'
-                     for i in os.listdir(self.repo_dir)]
+                f'[当前分支] {self.repo.active_branch} 工作区{"不" if self.repo.is_dirty() else ""}干净 -> {self.name}'
+            ]
+        listfile += [
+            f'{"[配置文件]" if i == ".git" else "[未跟踪]"if i in self.repo.untracked_files else "[已跟踪]"} {i}'
+            for i in os.listdir(self.repo_dir)
+        ]
         return listfile
 
     def add(self, file_list):
         file = self.get_flie_list(file_list)
         return subprocess.Popen(
-            f'echo 添加文件... && {git_path} add {file} && echo {self.make_stop_key()}',
+            f"echo 添加文件... && {git_path} add {file} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_cached_file(self, file_list):
         file = self.get_flie_list(file_list)
         return subprocess.Popen(
-            f'echo 撤销文件... && {git_path} rm --cached {file} && echo {self.make_stop_key()}',
+            f"echo 撤销文件... && {git_path} rm --cached {file} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def commit_file(self, m):
         return subprocess.Popen(
             f'echo 提交文件: && {git_path} commit -m "{m}" && echo {self.make_stop_key()}',
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def status(self):  # 执行status
         return subprocess.Popen(
-            f'echo 仓库状态: && {git_path} status && echo {self.make_stop_key()}',
+            f"echo 仓库状态: && {git_path} status && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def log(self, graph, pretty, abbrev):  # 执行log
-        args = ''
+        args = ""
         if graph:
-            args += ' --graph'
+            args += " --graph"
         if pretty:
-            args += ' --pretty=oneline'
+            args += " --pretty=oneline"
         if abbrev:
-            args += ' --abbrev-commit'
+            args += " --abbrev-commit"
         return subprocess.Popen(
-            f'echo 仓库日志: && {git_path} log{args} && echo {self.make_stop_key()}',
+            f"echo 仓库日志: && {git_path} log{args} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def do_log(self):  # 执行reflog
         return subprocess.Popen(
-            f'echo 操作记录: && {git_path} reflog && echo {self.make_stop_key()}',
+            f"echo 操作记录: && {git_path} reflog && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def diff(self, MASTER='HEAD'):  # 执行diff
+    def diff(self, master="HEAD"):  # 执行diff
         return subprocess.Popen(
-            f'echo 文件日志: && {git_path} diff {MASTER} && echo {self.make_stop_key()}',
+            f"echo 文件日志: && {git_path} diff {master} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def reset(self, HEAD='HEAD~1', Type=0):
-        if Type == 0:
-            type_ = '--mixed'  # 退回到工作区
-        elif Type == 1:
-            type_ = '--soft'  # 退回到暂存区
+    def reset(self, head="HEAD~1", reset_type=0):
+        if reset_type == 0:
+            type_ = "--mixed"  # 退回到工作区
+        elif reset_type == 1:
+            type_ = "--soft"  # 退回到暂存区
         else:
-            type_ = '--hard'  # 退回到暂存区
+            type_ = "--hard"  # 退回到暂存区
         return subprocess.Popen(
-            f'echo 回退... && {git_path} reset {type_} {HEAD} && echo {self.make_stop_key()}',
+            f"echo 回退... && {git_path} reset {type_} {head} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def checkout(self, file_list):
         if len(file_list) >= 1:  # 多于一个文件,不用--,空格
-            file = self.get_flie_list(file_list, pat=' ')
+            file = self.get_flie_list(file_list, pat=" ")
             return subprocess.Popen(
-                f'echo 丢弃修改: && {git_path} checkout {file} && echo {self.make_stop_key()}',
+                f"echo 丢弃修改: && {git_path} checkout {file} && echo {self.make_stop_key()}",
                 cwd=self.repo_dir,
-                **sys_seeting)
+                **sys_seeting,
+            )
         elif len(file_list) == 1:
             return subprocess.Popen(
-                f'echo 丢弃修改: && {git_path} checkout -- {file_list[0]} && echo {self.make_stop_key()}',
+                f"echo 丢弃修改: && {git_path} checkout -- {file_list[0]} && echo {self.make_stop_key()}",
                 cwd=self.repo_dir,
-                **sys_seeting)
+                **sys_seeting,
+            )
         else:
             return subprocess.Popen(
-                f'echo 丢弃修改: && {git_path} checkout * && echo {self.make_stop_key()}',
+                f"echo 丢弃修改: && {git_path} checkout * && echo {self.make_stop_key()}",
                 cwd=self.repo_dir,
-                **sys_seeting)
+                **sys_seeting,
+            )
 
     def rm(self, file_list):  # 删除版本库中的文件
         file = self.get_flie_list(file_list)
         return subprocess.Popen(
-            f'echo 删除... && {git_path} rm {file}',
-            cwd=self.repo_dir,
-            **sys_seeting)
+            f"echo 删除... && {git_path} rm {file}", cwd=self.repo_dir, **sys_seeting
+        )
 
     def branch_view(self):  # 查看本地分支和远程分支
         return subprocess.Popen(
-            f'echo 仓库分支: && {git_path} branch -a && echo 远程仓库信息: && {git_path} remote -v && '
-            f'echo 分支详情: && {git_path} branch -vv && echo {self.make_stop_key()}',
+            f"echo 仓库分支: && {git_path} branch -a && echo 远程仓库信息: && {git_path} remote -v && "
+            f"echo 分支详情: && {git_path} branch -vv && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def new_branch(self, branch_name, origin):  # 新建分支
         return subprocess.Popen(
-            f'echo 新建分支... && {git_path} branch {branch_name} {origin} && echo {self.make_stop_key()}',
+            f"echo 新建分支... && {git_path} branch {branch_name} {origin} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def switch_branch(self, branch_name):  # 切换分支
         return subprocess.Popen(
-            f'echo 切换分支... && {git_path} switch {branch_name} && echo {self.make_stop_key()}',
+            f"echo 切换分支... && {git_path} switch {branch_name} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_branch(self, branch_name, del_type):  # 删除分支
         return subprocess.Popen(
-            f'echo 删除分支... && {git_path} branch -{del_type} {branch_name} && echo {self.make_stop_key()}',
+            f"echo 删除分支... && {git_path} branch -{del_type} {branch_name} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def merge_branch(self, branch_name, no_ff, m=''):  # 合并分支
+    def merge_branch(self, branch_name, no_ff, m=""):  # 合并分支
         if no_ff:
             no_ff = f' --no-ff -m "{m}"'  # --no-ff前有空格
         else:
-            no_ff = ''
+            no_ff = ""
         return subprocess.Popen(
-            f'echo 合并分支... && {git_path} merge{no_ff} {branch_name} && echo {self.make_stop_key()}',
+            f"echo 合并分支... && {git_path} merge{no_ff} {branch_name} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def merge_abort(self):  # 退出冲突处理
         return subprocess.Popen(
-            f'echo 冲突处理退出... && {git_path} merge --abort && echo {self.make_stop_key()}',
+            f"echo 冲突处理退出... && {git_path} merge --abort && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def save_stash(self):  # 保存工作区
         return subprocess.Popen(
-            f'echo 保存工作区... && {git_path} stash && echo {self.make_stop_key()}',
+            f"echo 保存工作区... && {git_path} stash && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def get_stash_list(self):  # 工作区列表
         return subprocess.Popen(
-            f'echo 工作区列表: && {git_path} stash list && echo {self.make_stop_key()}',
+            f"echo 工作区列表: && {git_path} stash list && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def apply_stash(self, stash_num='0'):  # 恢复工作区
+    def apply_stash(self, stash_num="0"):  # 恢复工作区
         return subprocess.Popen(
-            f'echo 恢复工作区... && {git_path} stash apply stash@{{{stash_num}}} && echo {self.make_stop_key()}',
+            f"echo 恢复工作区... && {git_path} stash apply stash@{{{stash_num}}} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def drop_stash(self, stash_num='0'):  # 删除工作区
+    def drop_stash(self, stash_num="0"):  # 删除工作区
         return subprocess.Popen(
-            f'echo 删除工作区... && {git_path} stash drop stash@{{{stash_num}}} && echo {self.make_stop_key()}',
+            f"echo 删除工作区... && {git_path} stash drop stash@{{{stash_num}}} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def cherry_pick(self, commit):  # 补丁
         return subprocess.Popen(
-            f'echo 补丁... && {git_path} cherry-pick {commit} && echo {self.make_stop_key()}',
+            f"echo 补丁... && {git_path} cherry-pick {commit} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_remote(self, remote_name):
         return subprocess.Popen(
-            f'echo 删除远程仓库... && {git_path} remote remove {remote_name} && echo {self.make_stop_key()}',
+            f"echo 删除远程仓库... && {git_path} remote remove {remote_name} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def remote_add(self, remote, remote_name):
         return subprocess.Popen(
-            f'echo 添加远程仓库... && {git_path} remote add {remote_name} {remote} && echo {self.make_stop_key()}',
+            f"echo 添加远程仓库... && {git_path} remote add {remote_name} {remote} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def bind_branch(self, local_name, remote_name):
         return subprocess.Popen(
-            f'echo 分支绑定... && {git_path} branch --set-upstream-to={remote_name} {local_name} && echo {self.make_stop_key()}',
+            f"echo 分支绑定... && {git_path} branch --set-upstream-to={remote_name} {local_name} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def push_tag(self, tag, remote_name):
         return subprocess.Popen(
-            f'echo 推送标签... && {git_path} push {remote_name} {tag} && echo {self.make_stop_key()}',
+            f"echo 推送标签... && {git_path} push {remote_name} {tag} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_tag(self, tag):
         return subprocess.Popen(
-            f'echo 删除本地标签... && {git_path} tag -d {tag} && echo {self.make_stop_key()}',
+            f"echo 删除本地标签... && {git_path} tag -d {tag} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def add_tag(self, tag, commit, message=''):
-        a = ' -a'
-        if message != '':
+    def add_tag(self, tag, commit, message=""):
+        a = " -a"
+        if message != "":
             message = f' -m "{message}"'  # 自带空格
         else:
-            a = ''
-        if commit != '':
-            commit = f' {commit}'  # 自带空格
+            a = ""
+        if commit != "":
+            commit = f" {commit}"  # 自带空格
         return subprocess.Popen(
-            f'echo 添加标签... && {git_path} tag{a} {tag}{commit}{message} && echo {self.make_stop_key()}',
+            f"echo 添加标签... && {git_path} tag{a} {tag}{commit}{message} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
-    def get_tag_list(self, condition=''):
-        if condition != '':
-            condition = f' -l {condition}'
+    def get_tag_list(self, condition=""):
+        if condition != "":
+            condition = f" -l {condition}"
         return subprocess.Popen(
-            f'echo 标签列表: && {git_path} tag{condition} && echo {self.make_stop_key()}',
+            f"echo 标签列表: && {git_path} tag{condition} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def search_commit(self, condition):
         return subprocess.Popen(
-            f'echo 查询结果: && {git_path} show {condition} && echo {self.make_stop_key()}',
+            f"echo 查询结果: && {git_path} show {condition} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def pull_push(
         self,
         pull_or_push=0,
-        remote='',
-        remote_branch='',
-        local='',
+        remote="",
+        remote_branch="",
+        local="",
         allow=False,
         u=False,
-            f=False):
+        f=False,
+    ):
         # 处理逻辑
         # 1)remote去斜杠第一个作为主机名字
         # 2) 从remote分离主机名(如果没指定)
         # 3) 如果local为空,用HEAD填充
         # 4) 如果以上后,主机名仍为空,则local和分支均为空
 
-        split = remote.split('/')
+        split = remote.split("/")
         try:
             remote_name = split[0]  # 获取主机名 1)
         except BaseException:
-            remote_name = ''  # 没有主机名 1)
+            remote_name = ""  # 没有主机名 1)
 
-        branch_split = remote_branch.split('/')
-        if len(branch_split) >= 2 and remote_name == '':
+        branch_split = remote_branch.split("/")
+        if len(branch_split) >= 2 and remote_name == "":
             remote_name = branch_split[0]  # 2)
-            remote_branch = '/'.join(branch_split[1:])  # 2)
-        if local.replace(' ', '') == '':
-            local = 'HEAD'  # 3)
-        if remote_name == '':  # 4)
-            branch = ''
+            remote_branch = "/".join(branch_split[1:])  # 2)
+        if local.replace(" ", "") == "":
+            local = "HEAD"  # 3)
+        if remote_name == "":  # 4)
+            branch = ""
         else:
             if pull_or_push == 1:
                 # 注意,local不可以为空,也不会为空
-                if remote_branch != '':
+                if remote_branch != "":
                     # git push <远程主机名> <本地分支名>:<远程分支名>
-                    branch = f'{local}:{remote_branch}'
+                    branch = f"{local}:{remote_branch}"
                 else:
-                    branch = f'{local}'  # 要去掉冒号
+                    branch = f"{local}"  # 要去掉冒号
             else:
-                if remote_branch != 'HEAD':
+                if remote_branch != "HEAD":
                     # git push <远程主机名> <本地分支名>:<远程分支名>
-                    branch = f'{remote_branch}:{local}'
+                    branch = f"{remote_branch}:{local}"
                 else:
-                    branch = f'{remote_branch}'
+                    branch = f"{remote_branch}"
 
         if allow:
-            history = ' --allow-unrelated-histories'
+            history = " --allow-unrelated-histories"
         else:
-            history = ''
-        push_pull = {
-            0: "pull",
-            1: f"push{' -u' if u else ''}{' -f' if f else ''}"}
+            history = ""
+        push_pull = {0: "pull", 1: f"push{' -u' if u else ''}{' -f' if f else ''}"}
         return subprocess.Popen(
-            f'''echo 与服务器连接... && {git_path} {push_pull.get(pull_or_push, "pull")}{history} {remote_name} {branch} 
-&& echo {self.make_stop_key()}''',
+            f"""echo 与服务器连接... && {git_path} {push_pull.get(pull_or_push, "pull")}{history} {remote_name} {branch} 
+&& echo {self.make_stop_key()}""",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_branch_remote(self, remote, remote_branch):
-        remote_split = remote.split('/')
+        remote_split = remote.split("/")
         try:
             remote_name = remote_split[0]  # 获取主机名 1)
         except BaseException:
-            remote_name = ''  # 没有主机名 1)
-        branch_split = remote_branch.split('/')
-        if len(branch_split) >= 2 and remote_name == '':
+            remote_name = ""  # 没有主机名 1)
+        branch_split = remote_branch.split("/")
+        if len(branch_split) >= 2 and remote_name == "":
             remote_name = branch_split[0]  # 2)
-            remote_branch = '/'.join(branch_split[1:])  # 2)
+            remote_branch = "/".join(branch_split[1:])  # 2)
         return subprocess.Popen(
-            f'echo 删除远程分支... && {git_path} push {remote_name} :{remote_branch} && echo {self.make_stop_key()}',
+            f"echo 删除远程分支... && {git_path} push {remote_name} :{remote_branch} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def del_tag_remote(self, remote, tag):
         return subprocess.Popen(
-            f'echo 删除远程标签... && {git_path} push {remote} :refs/tags/{tag} && echo {self.make_stop_key()}',
+            f"echo 删除远程标签... && {git_path} push {remote} :refs/tags/{tag} && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def fetch(self, remote, remote_branch, local):
         # 处理逻辑
@@ -368,66 +404,76 @@ class GitRepo:  # git的基类
         # 3) 如果local为空,用HEAD填充
         # 4) 如果以上后,主机名仍为空,则local和分支均为空
 
-        split = remote.split('/')
+        split = remote.split("/")
         try:
             remote_name = split[0]  # 获取主机名 1)
         except BaseException:
-            remote_name = ''  # 没有主机名 1)
+            remote_name = ""  # 没有主机名 1)
 
-        branch_split = remote_branch.split('/')
-        if len(branch_split) >= 2 and remote_name == '':
+        branch_split = remote_branch.split("/")
+        if len(branch_split) >= 2 and remote_name == "":
             remote_name = branch_split[0]  # 2)
-            remote_branch = '/'.join(branch_split[1:])  # 2)
-        if local.replace(' ', '') == '':
-            local = 'HEAD'  # 3)
-        if remote_name == '':  # 4)
-            branch = ''
+            remote_branch = "/".join(branch_split[1:])  # 2)
+        if local.replace(" ", "") == "":
+            local = "HEAD"  # 3)
+        if remote_name == "":  # 4)
+            branch = ""
         else:
-            if remote_branch != 'HEAD':
+            if remote_branch != "HEAD":
                 # git push <远程主机名> <本地分支名>:<远程分支名>
-                branch = f'{remote_branch}:{local}'
+                branch = f"{remote_branch}:{local}"
             else:
-                branch = f'{remote_branch}'
+                branch = f"{remote_branch}"
 
         return subprocess.Popen(
-            f'''echo 更新远程仓库... && {git_path} fetch {remote_name} {branch} && echo {self.make_stop_key()}''',
+            f"""echo 更新远程仓库... && {git_path} fetch {remote_name} {branch} && echo {self.make_stop_key()}""",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def customize_command(self, command: str):
-        return subprocess.Popen(f'{command} && echo {self.make_stop_key()}', cwd=self.repo_dir, **sys_seeting)
+        return subprocess.Popen(
+            f"{command} && echo {self.make_stop_key()}",
+            cwd=self.repo_dir,
+            **sys_seeting,
+        )
 
     def clone(self, url):
         return subprocess.Popen(
-            f'echo 克隆操作不被允许 && echo {self.make_stop_key()}',
+            f"echo 克隆操作不被允许 && echo {self.make_stop_key()}",
             cwd=self.repo_dir,
-            **sys_seeting)
+            **sys_seeting,
+        )
 
     def make_dir(self, dir):
-        if len(dir) == '':
+        if len(dir) == "":
             return dir
-        inside = '/'
-        if dir[0] == '/':
-            inside = ''
+        inside = "/"
+        if dir[0] == "/":
+            inside = ""
         return self.repo_dir + inside + dir
 
     def reset_file(self, hard, file_list):  # 注意版本回退是:Reset_File
         file = self.get_flie_list(file_list)
         return subprocess.Popen(
-            f'''echo 回退文件... && {git_path} reset {hard} {file} && echo {self.make_stop_key()}''',
-            cwd=self.repo_dir, **sys_seeting)
+            f"""echo 回退文件... && {git_path} reset {hard} {file} && echo {self.make_stop_key()}""",
+            cwd=self.repo_dir,
+            **sys_seeting,
+        )
 
     def rename_branch(self, old_name, new_name):
         return subprocess.Popen(
-            f'''echo 回退文件... && {git_path} branch -m {old_name} {new_name} && echo {self.make_stop_key()}''',
-            cwd=self.repo_dir, **sys_seeting)
+            f"""echo 回退文件... && {git_path} branch -m {old_name} {new_name} && echo {self.make_stop_key()}""",
+            cwd=self.repo_dir,
+            **sys_seeting,
+        )
 
 
 class CloneGit(GitRepo):  # Clone一个git
-    def __init__(self, Dic, *args, **kwargs):
-        self.Repo_Dic = Dic  # 仓库地址
+    def __init__(self, repo_dir, *args, **kwargs):
+        self.Repo_Dic = repo_dir  # 仓库地址
         self.url = None
-        self.name = split(Dic)[-1]
+        self.name = split(repo_dir)[-1]
         self.have_clone = False
 
     def clone(self, url):
@@ -435,16 +481,16 @@ class CloneGit(GitRepo):  # Clone一个git
             super(CloneGit, self).clone(url)
         self.have_clone = True
         return subprocess.Popen(
-            f'echo 正在克隆... && {git_path} clone {url} {self.Repo_Dic}',
-            cwd=split(
-                self.Repo_Dic)[0],
-            **sys_seeting)
+            f"echo 正在克隆... && {git_path} clone {url} {self.Repo_Dic}",
+            cwd=split(self.Repo_Dic)[0],
+            **sys_seeting,
+        )
 
     def after_clone(self):
         self.repo = Repo(self.Repo_Dic)
 
 
-class git_Ctrol:
+class GitCtrol:
     def __init__(self):
         self.git_dict = {}  # 名字-文件位置
         self.git_type_dict = {}  # 名字-类型
@@ -452,13 +498,13 @@ class git_Ctrol:
     def open_repo(self, repo_dir, **kwargs):
         git = GitRepo(repo_dir)
         self.git_dict[git.name] = git
-        self.git_type_dict[git.name] = 'init'
+        self.git_type_dict[git.name] = "init"
         return git.name
 
     def clone_repo(self, repo_dir, **kwargs):
         git = CloneGit(repo_dir)
         self.git_dict[git.name] = git
-        self.git_type_dict[git.name] = 'clone'
+        self.git_type_dict[git.name] = "clone"
         return git.name
 
     def get_git(self, name):
@@ -513,7 +559,7 @@ class git_Ctrol:
         return self.get_git(name).switch_branch(branch_name)
 
     def del_branch(self, name, branch_name, type_):
-        d = {1: 'd', 0: 'D'}.get(type_, 'd')
+        d = {1: "d", 0: "D"}.get(type_, "d")
         return self.get_git(name).del_branch(branch_name, d)
 
     def merge_branch(self, name, branch_name, no_ff, m):
@@ -528,10 +574,10 @@ class git_Ctrol:
     def stash_list(self, name):
         return self.get_git(name).get_stash_list()
 
-    def apply_stash(self, name, stash_num='0'):
+    def apply_stash(self, name, stash_num="0"):
         return self.get_git(name).apply_stash(stash_num)
 
-    def drop_stash(self, name, stash_num='0'):
+    def drop_stash(self, name, stash_num="0"):
         return self.get_git(name).drop_stash(stash_num)
 
     def cherry_pick(self, name, commit):
@@ -546,35 +592,40 @@ class git_Ctrol:
     def bind_branch(self, name, local_name, remote_name):
         return self.get_git(name).bind_branch(local_name, remote_name)
 
-    def pull_from_remote(self, name, local_name, remote_name, remote_branch, allow=False, u=False):
+    def pull_from_remote(
+        self, name, local_name, remote_name, remote_branch, allow=False, u=False
+    ):
         return self.get_git(name).pull_push(
-            0, remote_name, remote_branch, local_name, allow, u, False)
+            0, remote_name, remote_branch, local_name, allow, u, False
+        )
 
-    def push_to_remote(self, name, local_name, remote_name, remote_branch, u=False, f=False):
+    def push_to_remote(
+        self, name, local_name, remote_name, remote_branch, u=False, f=False
+    ):
         return self.get_git(name).pull_push(
-            1, remote_name, remote_branch, local_name, False, u, f)  # push没有allow选项
+            1, remote_name, remote_branch, local_name, False, u, f
+        )  # push没有allow选项
 
-    def tag(self, name, condition=''):
+    def tag(self, name, condition=""):
         return self.get_git(name).get_tag_list(condition)  # push没有allow选项
 
     def show_new(self, name, condition):
         return self.get_git(name).search_commit(condition)  # push没有allow选项
 
-    def add_tag(self, name, tag, commit, message=''):
-        return self.get_git(name).add_tag(
-            tag, commit, message)  # push没有allow选项
+    def add_tag(self, name, tag, commit, message=""):
+        return self.get_git(name).add_tag(tag, commit, message)  # push没有allow选项
 
     def push_tag(self, name, tag, remoto):
         return self.get_git(name).push_tag(tag, remoto)
 
     def push_all_tag(self, name, remoto):
-        return self.get_git(name).push_tag('--tags', remoto)
+        return self.get_git(name).push_tag("--tags", remoto)
 
     def del_tag_remote(self, name, remote, tag):
         return self.get_git(name).del_tag_remote(remote, tag)
 
-    def del_branch_remote(self, name, remote, remote_Branch):
-        return self.get_git(name).del_branch_remote(remote, remote_Branch)
+    def del_branch_remote(self, name, remote, remote_branch):
+        return self.get_git(name).del_branch_remote(remote, remote_branch)
 
     def del_tag(self, name, tag):
         return self.get_git(name).del_tag(tag)

+ 369 - 479
HSCH/Func_Matlib.py

@@ -11,9 +11,10 @@ import tkinter.messagebox
 from os import path
 from HSCH.HS import ExpFunc, SheetFunc
 
-def type_selection(IN, si=float, n=True):  # Float筛选系统
+
+def type_selection(iter_object, si=float, n=True):  # Float筛选系统
     x = []
-    for i in IN:
+    for i in iter_object:
         try:
             if si(i) == si(0) and n:
                 continue
@@ -26,22 +27,22 @@ def type_selection(IN, si=float, n=True):  # Float筛选系统
 def plot_func():
     global func_list, definition_domain, fig, x_limit, y_limit, y_axis, x_axis
     # 画板创造
-    output_prompt('生成绘制取...')
-    fig = plt.figure(num='CoTan函数')  # 定义一个图像窗口
-    plt.grid(True, ls='--')  # 显示网格(不能放到后面,因为后面调整成为了笛卡尔坐标系)
+    output_prompt("生成绘制取...")
+    fig = plt.figure(num="CoTan函数")  # 定义一个图像窗口
+    plt.grid(True, ls="--")  # 显示网格(不能放到后面,因为后面调整成为了笛卡尔坐标系)
     axis = plt.gca()
-    axis.spines['right'].set_color('none')
-    axis.spines['top'].set_color('none')
-    axis.xaxis.set_ticks_position('bottom')
-    axis.yaxis.set_ticks_position('left')
-    axis.spines['bottom'].set_position(('data', 0))  # 设置x轴, y轴在(0, 0)的位置
-    axis.spines['left'].set_position(('data', 0))
+    axis.spines["right"].set_color("none")
+    axis.spines["top"].set_color("none")
+    axis.xaxis.set_ticks_position("bottom")
+    axis.yaxis.set_ticks_position("left")
+    axis.spines["bottom"].set_position(("data", 0))  # 设置x轴, y轴在(0, 0)的位置
+    axis.spines["left"].set_position(("data", 0))
     # 检测x
     try:
-        if x_axis.get()[0] == 'c':  # 如果输入函数cx#-10#10#1#1
+        if x_axis.get()[0] == "c":  # 如果输入函数cx#-10#10#1#1
             # 第一部分HS,第二部分S,第三部分E,第四部分KD,第五部分JD
-            plot_parameter = x_axis.get()[1:].split('#')
-            exp_parameter = ['x', -10, 10, 1, 2]  # 保护系统
+            plot_parameter = x_axis.get()[1:].split("#")
+            exp_parameter = ["x", -10, 10, 1, 2]  # 保护系统
             try:
                 exp_parameter[0] = plot_parameter[0]
                 exp_parameter[1] = int(plot_parameter[1])
@@ -54,29 +55,31 @@ def plot_func():
             x_exp_scale = type_selection(
                 ExpFunc(
                     plot_parameter[0],
-                    'x',
-                    '',
+                    "x",
+                    "",
                     plot_parameter[1],
                     plot_parameter[2],
                     plot_parameter[3],
-                    plot_parameter[4]).data_packet()[1])  # 取y
+                    plot_parameter[4],
+                ).data_packet()[1]
+            )  # 取y
             axis.set_xticks(x_exp_scale)
-        elif x_axis.get()[0] == 'y':  # 输入函数y
+        elif x_axis.get()[0] == "y":  # 输入函数y
             x_exp_scale = abs(int(x_axis.get()[1:]))
             x_major_locator = plt.MultipleLocator(x_exp_scale)
             axis.xaxis.set_major_locator(x_major_locator)
         else:  # 输入纯数字
-            x_exp_scale = type_selection(x_axis.get().split(','))
+            x_exp_scale = type_selection(x_axis.get().split(","))
             axis.set_xticks(x_exp_scale)
     except BaseException:
         x_major_locator = plt.MultipleLocator(2)
         axis.xaxis.set_major_locator(x_major_locator)
     # 检测y
     try:  # 意外捕捉
-        if y_axis.get()[0] == 'c':  # 如果输入函数cx#-10#10#1#1
+        if y_axis.get()[0] == "c":  # 如果输入函数cx#-10#10#1#1
             # 第一部分HS,第二部分S,第三部分E,第四部分KD,第五部分JD
-            plot_parameter = y_axis.get()[1:].split('#')
-            exp_parameter = ['x', -10, 10, 1, 2]  # 保护系统
+            plot_parameter = y_axis.get()[1:].split("#")
+            exp_parameter = ["x", -10, 10, 1, 2]  # 保护系统
             try:
                 exp_parameter[0] = plot_parameter[0]
                 exp_parameter[1] = int(plot_parameter[1])
@@ -89,27 +92,29 @@ def plot_func():
             y_exp_scale = type_selection(
                 ExpFunc(
                     plot_parameter[0],
-                    'y',
-                    '',
+                    "y",
+                    "",
                     plot_parameter[1],
                     plot_parameter[2],
                     plot_parameter[3],
-                    plot_parameter[4]).data_packet()[1])  # 取y
+                    plot_parameter[4],
+                ).data_packet()[1]
+            )  # 取y
             axis.set_yticks(y_exp_scale)
-        elif y_axis.get()[0] == 'y':  # 输入函数y
+        elif y_axis.get()[0] == "y":  # 输入函数y
             y_exp_scale = abs(int(y_axis.get()[1:]))
             y_major_locator = plt.MultipleLocator(y_exp_scale)
             axis.yaxis.set_major_locator(y_major_locator)
         else:
-            y_exp_scale = type_selection(y_axis.get().split(','))
+            y_exp_scale = type_selection(y_axis.get().split(","))
             axis.set_yticks(y_exp_scale)
     except BaseException:
         y_major_locator = plt.MultipleLocator(2)
         axis.yaxis.set_major_locator(y_major_locator)
     # 极限
     try:
-        _x_limit = type_selection(x_limit.get().split(','), si=int, n=False)
-        _y_limit = type_selection(y_limit.get().split(','), si=int, n=False)
+        _x_limit = type_selection(x_limit.get().split(","), si=int, n=False)
+        _y_limit = type_selection(y_limit.get().split(","), si=int, n=False)
         try:
             _x_limit = [_x_limit[0], _x_limit[1]]
         except BaseException:
@@ -126,7 +131,7 @@ def plot_func():
     plt.xlim(_x_limit)
     plt.ylim(_y_limit)
     # 函数绘图系统
-    output_prompt('图像绘制中...')
+    output_prompt("图像绘制中...")
     if not func_list:
         return False
     for Fucn in func_list:
@@ -140,7 +145,9 @@ def plot_func():
             x_exp_scale = plot_x[i]
             y_exp_scale = plot_y[i]
             if first:
-                plt.plot(x_exp_scale, y_exp_scale, exp_style, label=func_label)  # plot()画出曲线
+                plt.plot(
+                    x_exp_scale, y_exp_scale, exp_style, label=func_label
+                )  # plot()画出曲线
                 first = False
             else:
                 plt.plot(x_exp_scale, y_exp_scale, exp_style)
@@ -149,10 +156,8 @@ def plot_func():
         memory_y = get[1]
         max_x, max_y, min_x, min_y = Fucn.best_value()
         plt.plot(
-            memory_x,
-            memory_y,
-            exp_style[0] + 'o',
-            label=f'Point of {func_label}')  # 画出一些点
+            memory_x, memory_y, exp_style[0] + "o", label=f"Point of {func_label}"
+        )  # 画出一些点
         len_x = sorted(list(set(memory_x)))  # 去除list重复项目
         extreme_points = max_x + min_x
 
@@ -165,8 +170,11 @@ def plot_func():
                 num = memory_x.index(now_x)  # y的座位
                 now_y = memory_y[num]
                 plt.text(
-                    now_x, now_y, f'({now_x},{int(now_y)})', fontdict={
-                        'size': '10', 'color': 'b'})  # 标出坐标
+                    now_x,
+                    now_y,
+                    f"({now_x},{int(now_y)})",
+                    fontdict={"size": "10", "color": "b"},
+                )  # 标出坐标
                 last_x = now_x
 
         last_x = None
@@ -177,10 +185,9 @@ def plot_func():
                 plt.text(
                     now_x - 1,
                     max_y,
-                    f'max:({now_x},{int(max_y)})',
-                    fontdict={
-                        'size': '10',
-                        'color': 'b'})  # 标出坐标
+                    f"max:({now_x},{int(max_y)})",
+                    fontdict={"size": "10", "color": "b"},
+                )  # 标出坐标
                 plot_max.append(now_x)
                 last_x = now_x
 
@@ -193,14 +200,13 @@ def plot_func():
                 plt.text(
                     now_x - 1,
                     min_y,
-                    f'min:({now_x},{int(min_y)})',
-                    fontdict={
-                        'size': '10',
-                        'color': 'b'})  # 标出坐标
+                    f"min:({now_x},{int(min_y)})",
+                    fontdict={"size": "10", "color": "b"},
+                )  # 标出坐标
                 last_x = now_x
-        plt.plot(plot_min, [min_y] * len(plot_min), exp_style[0] + 'o')  # 画出一些点
-        plt.plot(plot_max, [max_y] * len(plot_max), exp_style[0] + 'o')  # 画出一些点
-    output_prompt('绘制完毕')
+        plt.plot(plot_min, [min_y] * len(plot_min), exp_style[0] + "o")  # 画出一些点
+        plt.plot(plot_max, [max_y] * len(plot_max), exp_style[0] + "o")  # 画出一些点
+    output_prompt("绘制完毕")
     plt.legend()  # 显示图示
     plt.show()  # 显示图像
     return True
@@ -208,72 +214,72 @@ def plot_func():
 
 def add_from_csv():  # 添加函数
     global func_list, func_str_list, func_exp_box, definition_domain, func_name, line_style, point_style, func_style
-    file = tkinter.filedialog.askopenfilename(
-        title='载入表格', filetypes=[("CSV", ".csv")])
-    style_str = func_style.get().split('#')
+    file = tkinter.filedialog.askopenfilename(title="载入表格", filetypes=[("CSV", ".csv")])
+    style_str = func_style.get().split("#")
     try:
         if style_str[0] not in point_style:
-            style_str[0] = 'b'
-        line_style_str = line_style.get(style_str[1], '-')
+            style_str[0] = "b"
+        line_style_str = line_style.get(style_str[1], "-")
     except BaseException:
-        style_str = ['', '']
+        style_str = ["", ""]
         style_str[0] = random.choice(point_style)
-        line_style_str = '-'
+        line_style_str = "-"
     style = style_str[0] + line_style_str
     try:
-        output_prompt('读取CSV')
+        output_prompt("读取CSV")
         read = pandas.read_csv(file)
-        name = path.basename(file)[0:-4].replace(' ', '')
+        name = path.basename(file)[0:-4].replace(" ", "")
         if not name:
             name = random.randint(1, 1000)
-        name += '(In CSV)'
+        name += "(In CSV)"
         _func = numpy.array(read).tolist()
         func_str_list.append(name)
         func_list.append(SheetFunc(_func, name, style))
         func_exp_box.delete(0, tkinter.END)
         func_exp_box.insert(tkinter.END, *func_list)
-        output_prompt('读取完毕')
+        output_prompt("读取完毕")
     except BaseException:
-        output_prompt('读取失败')
+        output_prompt("读取失败")
 
 
 def add_func():  # 添加函数
     global func_list, func_str_list, func_exp_box, func_name, line_style, point_style, func_style, definition_domain
-    get = func_exp.get().replace(' ', '')
-    definition = definition_domain.get().split(',')
-    name = func_name.get().replace(' ', '')
-    style_str = func_style.get().split('#')
+    get = func_exp.get().replace(" ", "")
+    definition = definition_domain.get().split(",")
+    name = func_name.get().replace(" ", "")
+    style_str = func_style.get().split("#")
     if not name:
         name = get
     try:
         if style_str[0] not in point_style:
-            style_str[0] = 'b'
-        line_style_str = line_style.get(style_str[1], '-')
+            style_str[0] = "b"
+        line_style_str = line_style.get(style_str[1], "-")
     except BaseException:
-        style_str = ['', '']
+        style_str = ["", ""]
         style_str[0] = random.choice(point_style)
-        line_style_str = '-'
+        line_style_str = "-"
     style = style_str[0] + line_style_str
     try:
         span_str = definition[2]
-        if span_str[0] == 'H':
-            Name = {
-                'Pi': math.pi,
-                'e': math.e,
-                'log': math.log,
-                'sin': math.sin,
-                'cos': math.cos,
-                'tan': math.tan,
-                'cot': lambda x: 1 / math.tan(x),
-                'csc': lambda x: 1 / math.sin(x),
-                'sec': lambda x: 1 / math.cos(x),
-                'sinh': math.sinh,
-                'cosh': math.cosh,
-                'tanh': math.tanh,
-                'asin': math.asin,
-                'acos': math.acos,
-                'atan': math.atan}
-            definition[2] = eval(span_str[1:], Name)
+        if span_str[0] == "H":
+            named_domain = {
+                "Pi": math.pi,
+                "e": math.e,
+                "log": math.log,
+                "sin": math.sin,
+                "cos": math.cos,
+                "tan": math.tan,
+                "cot": lambda x: 1 / math.tan(x),
+                "csc": lambda x: 1 / math.sin(x),
+                "sec": lambda x: 1 / math.cos(x),
+                "sinh": math.sinh,
+                "cosh": math.cosh,
+                "tanh": math.tanh,
+                "asin": math.asin,
+                "acos": math.acos,
+                "atan": math.atan,
+            }
+            definition[2] = eval(span_str[1:], named_domain)
     except BaseException:
         pass
     if get and get not in func_str_list:
@@ -281,29 +287,29 @@ def add_func():  # 添加函数
         func_list.append(ExpFunc(get, name, style, *definition))
         func_exp_box.delete(0, tkinter.END)
         func_exp_box.insert(tkinter.END, *func_list)
-        output_prompt('函数生成完毕')
+        output_prompt("函数生成完毕")
     else:
-        output_prompt('函数生成失败')
+        output_prompt("函数生成失败")
 
 
 def clean_func_box():  # 添加函数
     global func_list, func_str_list, func_exp_box, x_I, func_name, line_style, point_style, func_style
-    if tkinter.messagebox.askokcancel('提示', '是否清空所有函数?)'):
+    if tkinter.messagebox.askokcancel("提示", "是否清空所有函数?)"):
         func_str_list = []
         func_list = []
         func_exp_box.delete(0, tkinter.END)
-        output_prompt('函数清空完毕')
+        output_prompt("函数清空完毕")
 
 
 def func_to_sheet():  # 显示xy
     global func_list, func_exp_box, sheet_box
     try:
-        Fucn = func_list[func_exp_box.curselection()[0]]
+        func = func_list[func_exp_box.curselection()[0]]
         sheet_box.delete(0, tkinter.END)
-        sheet_box.insert(tkinter.END, *Fucn.return_list())
-        output_prompt('表格创建成功')
+        sheet_box.insert(tkinter.END, *func.return_list())
+        output_prompt("表格创建成功")
     except BaseException:
-        output_prompt('无法创建表格')
+        output_prompt("无法创建表格")
         pass
 
 
@@ -311,15 +317,16 @@ def clean_func_memory():
     global x_value, func_exp_box, func_list
     try:
         if tkinter.messagebox.askokcancel(
-                '提示', f'确定删除{func_list[func_exp_box.curselection()[0]]}的记忆吗?'):
+            "提示", f"确定删除{func_list[func_exp_box.curselection()[0]]}的记忆吗?"
+        ):
             result_box.delete(0, tkinter.END)
-            Fucn = func_list[func_exp_box.curselection()[0]]
-            Fucn.clean_memory()
-            output_prompt('删除完毕')
+            fucn = func_list[func_exp_box.curselection()[0]]
+            fucn.clean_memory()
+            output_prompt("删除完毕")
         else:
-            output_prompt('删除取消')
+            output_prompt("删除取消")
     except BaseException:
-        output_prompt('删除失败')
+        output_prompt("删除失败")
 
 
 def hide_memory():  # 显示xy
@@ -328,51 +335,51 @@ def hide_memory():  # 显示xy
         func = func_list[func_exp_box.curselection()[0]]
         result_box.delete(0, tkinter.END)
         func.hide_or_show()
-        output_prompt('已清空卡槽')
+        output_prompt("已清空卡槽")
     except BaseException:
-        output_prompt('隐藏(显示)失败')
+        output_prompt("隐藏(显示)失败")
 
 
 def show_memory():  # 显示xy
     global func_list, result_box
     try:
-        Fucn = func_list[func_exp_box.curselection()[0]]
+        fucn = func_list[func_exp_box.curselection()[0]]
         result_box.delete(0, tkinter.END)
-        m_x, m_y = Fucn.get_memory()
+        m_x, m_y = fucn.get_memory()
         answer = []
         for i in range(len(m_x)):
-            answer.append(f'x={m_x[i]} -> y={m_y[i]}')
+            answer.append(f"x={m_x[i]} -> y={m_y[i]}")
         result_box.insert(tkinter.END, *answer)
-        output_prompt('输出完成')
+        output_prompt("输出完成")
     except BaseException:
-        output_prompt('操作失败')
+        output_prompt("操作失败")
 
 
 def property_prediction():
     global func_list, func_exp_box, property_box
     try:
-        output_prompt('预测过程程序可能无响应')
-        Fucn = func_list[func_exp_box.curselection()[0]]
+        output_prompt("预测过程程序可能无响应")
+        fucn = func_list[func_exp_box.curselection()[0]]
         property_box.delete(0, tkinter.END)
-        answer = Fucn.property_prediction(output_prompt)
+        answer = fucn.property_prediction(output_prompt)
         property_box.insert(tkinter.END, *answer)
-        output_prompt('性质预测完成')
+        output_prompt("性质预测完成")
     except IndexError:
-        output_prompt('性质预测失败')
+        output_prompt("性质预测失败")
 
 
 def calculate():
     global func_list, result_box, x_value, func_exp_box
     try:
-        output_prompt('计算过程程序可能无响应')
-        Fucn = func_list[func_exp_box.curselection()[0]]
+        output_prompt("计算过程程序可能无响应")
+        fucn = func_list[func_exp_box.curselection()[0]]
         result_box.delete(0, tkinter.END)
-        x = x_value.get().split(',')
-        answer = Fucn.calculate(x)
+        x = x_value.get().split(",")
+        answer = fucn.calculate(x)
         result_box.insert(tkinter.END, *answer)
-        output_prompt('系统计算完毕')
+        output_prompt("系统计算完毕")
     except IndexError:
-        output_prompt('计算失败')
+        output_prompt("计算失败")
 
 
 def func_to_csv():  # 导出CSV
@@ -380,61 +387,61 @@ def func_to_csv():  # 导出CSV
     if not func_exp_box.curselection():
         return False
     try:
-        Fucn = func_list[func_exp_box.curselection()[0]]
-        Fucn.save_csv()
-        output_prompt('CSV导出成功')
+        fucn = func_list[func_exp_box.curselection()[0]]
+        fucn.save_csv()
+        output_prompt("CSV导出成功")
     except BaseException:
-        output_prompt('CSV导出失败')
+        output_prompt("CSV导出失败")
 
 
 def del_func():  # 删除函数
     global func_list, func_str_list, func_exp_box
-    del_Fucn = func_exp_box.curselection()
-    for i in del_Fucn:  # 只存在一项
+    del_fucn = func_exp_box.curselection()
+    for i in del_fucn:  # 只存在一项
         func_exp_box.delete(i)
         del func_list[i]
         del func_str_list[i]
-        output_prompt('函数删除完毕')
+        output_prompt("函数删除完毕")
 
 
 def dichotomy():
     global func_list, result_box, y_value, dicon_parameters
     try:
-        output_prompt('计算过程程序可能无响应')
-        Fucn = func_list[func_exp_box.curselection()[0]]  # 获取目标函数
+        output_prompt("计算过程程序可能无响应")
+        fucn = func_list[func_exp_box.curselection()[0]]  # 获取目标函数
         result_box.delete(0, tkinter.END)  # 清空
-        y = y_value.get().split(',')  # 拆解输入
-        E = dicon_parameters.get().split('#')  # 拆解输入
+        y = y_value.get().split(",")  # 拆解输入
+        parameters = dicon_parameters.get().split("#")  # 拆解输入
         answer = []
-        output_prompt('系统运算中')
+        output_prompt("系统运算中")
         for i in y:
-            answer += Fucn.dichotomy(float(i), *E)[0]
+            answer += fucn.dichotomy(float(i), *parameters)[0]
         if answer:
-            output_prompt('系统运算完成')
+            output_prompt("系统运算完成")
             result_box.insert(tkinter.END, *answer)
         else:
-            output_prompt('系统运算无结果')
+            output_prompt("系统运算无结果")
     except BaseException:
-        output_prompt('系统运算失败')
+        output_prompt("系统运算失败")
         result_box.delete(0, tkinter.END)
 
 
 def gradient_method_calculation():
     global func_list, result_box, y_value_gradient
     try:
-        output_prompt('计算过程程序可能无响应')
-        Fucn = func_list[func_exp_box.curselection()[0]]  # 获取目标函数
+        output_prompt("计算过程程序可能无响应")
+        fucn = func_list[func_exp_box.curselection()[0]]  # 获取目标函数
         result_box.delete(0, tkinter.END)  # 清空
-        E = y_value_gradient.get().split('#')  # 拆解输入
-        output_prompt('系统运算中')
-        answer = Fucn.gradient_calculation(*E)
+        parameters = y_value_gradient.get().split("#")  # 拆解输入
+        output_prompt("系统运算中")
+        answer = fucn.gradient_calculation(*parameters)
         if answer[1]:
             result_box.insert(tkinter.END, answer[0])
-            output_prompt('系统运算完成')
+            output_prompt("系统运算完成")
         else:
-            output_prompt('系统运算无结果')
+            output_prompt("系统运算无结果")
     except BaseException:
-        output_prompt('系统运算失败,请注意参数设置')
+        output_prompt("系统运算失败,请注意参数设置")
         result_box.delete(0, tkinter.END)
 
 
@@ -442,36 +449,36 @@ def output_prompt(news):
     global prompt_box, prompt_num
     prompt_num += 1
     news = str(news)
-    prompt_box.insert(0, news + f'({prompt_num})')
+    prompt_box.insert(0, news + f"({prompt_num})")
     SCREEN.update()
 
 
 def func_differentiation():
     global func_list, func_exp_box, property_box, func_str_list, x_I, func_name, line_style, point_style, func_style
     try:
-        Fucn = func_list[func_exp_box.curselection()[0]]
-        DHS = Fucn.DHS
-        if DHS is not None and str(DHS):
-            get = str(DHS)
+        fucn = func_list[func_exp_box.curselection()[0]]
+        diff = fucn.derivatives
+        if diff is not None and str(diff):
+            get = str(diff)
             func_str_list.append(get)
             func_list.append(
                 ExpFunc(
                     get,
-                    '(导)' +
-                    Fucn.Func_Name +
-                    ' Of ',
-                    Fucn.View,
-                    Fucn.start,
-                    Fucn.end,
-                    Fucn.kd,
-                    Fucn.JD))
+                    "(导)" + fucn.Func_Name + " Of ",
+                    fucn.View,
+                    fucn.start,
+                    fucn.end,
+                    fucn.kd,
+                    fucn.JD,
+                )
+            )
             func_exp_box.delete(0, tkinter.END)
             func_exp_box.insert(tkinter.END, *func_list)
-            output_prompt('函数生成完毕')
+            output_prompt("函数生成完毕")
         else:
             raise Exception
     except BaseException:
-        output_prompt('导函数创建失败')
+        output_prompt("导函数创建失败")
 
 
 def function_mapping():
@@ -485,468 +492,351 @@ def function_mapping():
 
     # 控制面板使用Tk实现
     SCREEN = tkinter.Tk()  # 设置屏幕
-    SCREEN.title('CoTan函数测绘')
+    SCREEN.title("CoTan函数测绘")
     SCREEN.resizable(width=False, height=False)
-    SCREEN.geometry(f'+10+10')
-    FONT = (r'Font\ZKST.ttf', 11)  # 设置字体
-    rcParams['font.family'] = 'simhei'
-    rcParams['axes.unicode_minus'] = False
-
-    line_style = {'实线': '-',
-              '短横线': '--',
-              '点划线': '-,',
-              '虚线': ':',
-              '点标记': '.',
-              '圆标记': 'o',
-              '倒三角': 'v',
-              '正三角': '^',
-              '左三角': '&lt',
-              '下箭头': '1',
-              '上箭头': '2',
-                  '左箭头': '3',
-                  '右箭头': '4',
-                  '正方形': 's',
-                  '五边形': 'p',
-                  '星形': '*',
-                  '六边形': 'h',
-                  '六边形2': 'H',
-                  '+号': '+',
-                  'X标记': 'x', }  # 函数样式翻译表
-    point_style = ['g', 'r', 'c', 'm', 'y', 'k']
+    SCREEN.geometry(f"+10+10")
+    FONT = (r"Font\ZKST.ttf", 11)  # 设置字体
+    rcParams["font.family"] = "simhei"
+    rcParams["axes.unicode_minus"] = False
+
+    line_style = {
+        "实线": "-",
+        "短横线": "--",
+        "点划线": "-,",
+        "虚线": ":",
+        "点标记": ".",
+        "圆标记": "o",
+        "倒三角": "v",
+        "正三角": "^",
+        "左三角": "&lt",
+        "下箭头": "1",
+        "上箭头": "2",
+        "左箭头": "3",
+        "右箭头": "4",
+        "正方形": "s",
+        "五边形": "p",
+        "星形": "*",
+        "六边形": "h",
+        "六边形2": "H",
+        "+号": "+",
+        "X标记": "x",
+    }  # 函数样式翻译表
+    point_style = ["g", "r", "c", "m", "y", "k"]
     csv_list = []
 
-    width_B = 12  # 标准宽度
-    height_B = 1
+    gui_width = 12  # 标准宽度
+    gui_height = 1
     # column-水平方向,row-竖直方向
     # 设置解析式
     tkinter.Label(
-        SCREEN,
-        text='输入解析式:',
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=0,
-        row=0)  # 设置说明
-    func_exp = tkinter.Entry(SCREEN, width=width_B * 2)
-    func_exp.grid(
-        column=1,
-        row=0,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, text="输入解析式:", font=FONT, width=gui_width, height=gui_height
+    ).grid(
+        column=0, row=0
+    )  # 设置说明
+    func_exp = tkinter.Entry(SCREEN, width=gui_width * 2)
+    func_exp.grid(column=1, row=0, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     # 设置定义域
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='定义域:',
-        width=width_B,
-        height=height_B).grid(
-        column=0,
-        row=1)  # 设置说明
-    definition_domain = tkinter.Entry(SCREEN, width=width_B * 2)
+        SCREEN, font=FONT, text="定义域:", width=gui_width, height=gui_height
+    ).grid(
+        column=0, row=1
+    )  # 设置说明
+    definition_domain = tkinter.Entry(SCREEN, width=gui_width * 2)
     definition_domain.grid(column=1, row=1, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     # 设置函数名字
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='函数名字:',
-        width=width_B,
-        height=height_B).grid(
-        column=0,
-        row=2)  # 设置说明
-    func_name = tkinter.Entry(SCREEN, width=width_B * 2)
-    func_name.grid(
-        column=1,
-        row=2,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="函数名字:", width=gui_width, height=gui_height
+    ).grid(
+        column=0, row=2
+    )  # 设置说明
+    func_name = tkinter.Entry(SCREEN, width=gui_width * 2)
+    func_name.grid(column=1, row=2, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     # 设置函数图示
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='函数样式:',
-        width=width_B,
-        height=height_B).grid(
-        column=0,
-        row=3)  # 设置说明
-    func_style = tkinter.Entry(SCREEN, width=width_B * 2)
-    func_style.grid(
-        column=1,
-        row=3,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="函数样式:", width=gui_width, height=gui_height
+    ).grid(
+        column=0, row=3
+    )  # 设置说明
+    func_style = tkinter.Entry(SCREEN, width=gui_width * 2)
+    func_style.grid(column=1, row=3, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y = 4  # 按钮统一纵坐标
     tkinter.Button(
         SCREEN,
-        text='添加新函数',
+        text="添加新函数",
         command=add_func,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=0,
-        row=a_y)  # 添加函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=0, row=a_y
+    )  # 添加函数
     tkinter.Button(
         SCREEN,
-        text='删除选中函数',
+        text="删除选中函数",
         command=del_func,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=1,
-        row=a_y)  # 删除函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=1, row=a_y
+    )  # 删除函数
     tkinter.Button(
         SCREEN,
-        text='清除函数',
+        text="清除函数",
         command=clean_func_box,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=2,
-        row=a_y)  # 绘制函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=2, row=a_y
+    )  # 绘制函数
     a_y += 1
     # 显示函数
-    func_exp_box = tkinter.Listbox(SCREEN, width=width_B * 3 + 2)  # 暂时不启用多选
-    TD_a_y = 10
+    func_exp_box = tkinter.Listbox(SCREEN, width=gui_width * 3 + 2)  # 暂时不启用多选
+    rowspan = 10
     func_exp_box.grid(
         column=0,
         row=a_y,
         columnspan=3,
-        rowspan=TD_a_y,
-        sticky=tkinter.S +
-        tkinter.N +
-        tkinter.E +
-        tkinter.W)
-    a_y += TD_a_y
-    tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='',
-        width=width_B,
-        height=1).grid(
-        column=0,
-        row=a_y)
-
-    tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='',
-        width=1).grid(
-        column=4,
-        row=0)  # 占用第四
+        rowspan=rowspan,
+        sticky=tkinter.S + tkinter.N + tkinter.E + tkinter.W,
+    )
+    a_y += rowspan
+    tkinter.Label(SCREEN, font=FONT, text="", width=gui_width, height=1).grid(
+        column=0, row=a_y
+    )
+
+    tkinter.Label(SCREEN, font=FONT, text="", width=1).grid(column=4, row=0)  # 占用第四
     a_y = 0
     # 输入x函数求y值
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='计算(y):',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    x_value = tkinter.Entry(SCREEN, width=width_B * 2)
-    x_value.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="计算(y):", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    x_value = tkinter.Entry(SCREEN, width=gui_width * 2)
+    x_value.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     # 输入x函数求y值
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='二分法计算(y):',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    y_value = tkinter.Entry(SCREEN, width=width_B * 2)
-    y_value.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="二分法计算(y):", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    y_value = tkinter.Entry(SCREEN, width=gui_width * 2)
+    y_value.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='二分法参数:',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    dicon_parameters = tkinter.Entry(SCREEN, width=width_B * 2)
+        SCREEN, font=FONT, text="二分法参数:", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    dicon_parameters = tkinter.Entry(SCREEN, width=gui_width * 2)
     dicon_parameters.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     # 输入x函数求y值
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='梯度法计算(y):',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    y_value_gradient = tkinter.Entry(SCREEN, width=width_B * 2)
-    y_value_gradient.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="梯度法计算(y):", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    y_value_gradient = tkinter.Entry(SCREEN, width=gui_width * 2)
+    y_value_gradient.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     tkinter.Button(
         SCREEN,
-        text='计算(y)',
+        text="计算(y)",
         command=calculate,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
     tkinter.Button(
         SCREEN,
-        text='二分法计算(x)',
+        text="二分法计算(x)",
         command=dichotomy,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=6,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=6, row=a_y)
     tkinter.Button(
         SCREEN,
-        text='梯度法计算(x)',
+        text="梯度法计算(x)",
         command=gradient_method_calculation,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=7,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=7, row=a_y)
 
     a_y += 1
     # 绘制函数坐标表格
     tkinter.Button(
         SCREEN,
-        text='查看记忆',
+        text="查看记忆",
         command=show_memory,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=5, row=a_y)
     tkinter.Button(
         SCREEN,
-        text='隐藏记忆',
+        text="隐藏记忆",
         command=hide_memory,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=6,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=6, row=a_y)
     tkinter.Button(
         SCREEN,
-        text='清空记忆',
+        text="清空记忆",
         command=clean_func_memory,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=7,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=7, row=a_y)
 
     a_y += 1
     # 显示函数
-    result_box = tkinter.Listbox(SCREEN, width=width_B * 3 + 2, height=17)  # 暂时不启用多选
+    result_box = tkinter.Listbox(SCREEN, width=gui_width * 3 + 2, height=17)  # 暂时不启用多选
     result_box.grid(
-        column=5,
-        row=a_y,
-        columnspan=3,
-        sticky=tkinter.N +
-        tkinter.E +
-        tkinter.W)
+        column=5, row=a_y, columnspan=3, sticky=tkinter.N + tkinter.E + tkinter.W
+    )
 
     a_y += 1
     # 设置坐标系刻度
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='X轴(函数):',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y,
-        sticky=tkinter.N)  # 设置说明
-    x_axis = tkinter.Entry(SCREEN, width=width_B * 2)
+        SCREEN, font=FONT, text="X轴(函数):", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y, sticky=tkinter.N
+    )  # 设置说明
+    x_axis = tkinter.Entry(SCREEN, width=gui_width * 2)
     x_axis.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.N +
-        tkinter.E +
-        tkinter.W)
+        column=6, row=a_y, columnspan=2, sticky=tkinter.N + tkinter.E + tkinter.W
+    )
 
     a_y += 1
     # 设置坐标系刻度
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='Y轴(函数):',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    y_axis = tkinter.Entry(SCREEN, width=width_B * 2)
-    y_axis.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="Y轴(函数):", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    y_axis = tkinter.Entry(SCREEN, width=gui_width * 2)
+    y_axis.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     # 设置坐标系刻度
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='X轴极限:',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    x_limit = tkinter.Entry(SCREEN, width=width_B * 2)
-    x_limit.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="X轴极限:", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    x_limit = tkinter.Entry(SCREEN, width=gui_width * 2)
+    x_limit.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     # 设置坐标系刻度
     tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='Y轴极限:',
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 设置说明
-    y_limit = tkinter.Entry(SCREEN, width=width_B * 2)
-    y_limit.grid(
-        column=6,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN, font=FONT, text="Y轴极限:", width=gui_width, height=gui_height
+    ).grid(
+        column=5, row=a_y
+    )  # 设置说明
+    y_limit = tkinter.Entry(SCREEN, width=gui_width * 2)
+    y_limit.grid(column=6, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
 
     a_y += 1
     tkinter.Button(
         SCREEN,
-        text='绘制函数',
+        text="绘制函数",
         command=plot_func,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=5,
-        row=a_y)  # 绘制函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=5, row=a_y
+    )  # 绘制函数
     tkinter.Button(
         SCREEN,
-        text='计算性质',
+        text="计算性质",
         command=property_prediction,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=6,
-        row=a_y)  # 绘制函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=6, row=a_y
+    )  # 绘制函数
     tkinter.Button(
         SCREEN,
-        text='创建导函数',
+        text="创建导函数",
         command=func_differentiation,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=7,
-        row=a_y)  # 绘制函数
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=7, row=a_y
+    )  # 绘制函数
     a_y += 1
-    property_box = tkinter.Listbox(SCREEN, width=width_B * 3 + 2, height=10)  # 暂时不启用多选
+    property_box = tkinter.Listbox(
+        SCREEN, width=gui_width * 3 + 2, height=10
+    )  # 暂时不启用多选
     property_box.grid(
-        column=5,
-        row=a_y,
-        columnspan=3,
-        sticky=tkinter.N +
-        tkinter.E +
-        tkinter.W)
+        column=5, row=a_y, columnspan=3, sticky=tkinter.N + tkinter.E + tkinter.W
+    )
     a_y += 1
-    prompt_box = tkinter.Listbox(SCREEN, width=width_B * 3 + 2, height=5)  # 暂时不启用多选
+    prompt_box = tkinter.Listbox(SCREEN, width=gui_width * 3 + 2, height=5)  # 暂时不启用多选
     prompt_box.grid(
-        column=5,
-        row=a_y,
-        columnspan=3,
-        sticky=tkinter.N +
-        tkinter.E +
-        tkinter.W)
+        column=5, row=a_y, columnspan=3, sticky=tkinter.N + tkinter.E + tkinter.W
+    )
 
-    tkinter.Label(
-        SCREEN,
-        font=FONT,
-        text='',
-        width=1).grid(
-        column=8,
-        row=a_y)  # 占用第四
+    tkinter.Label(SCREEN, font=FONT, text="", width=1).grid(column=8, row=a_y)  # 占用第四
     a_y = 0
 
     # 绘制函数坐标表格
     tkinter.Button(
         SCREEN,
-        text='导入表格',
+        text="导入表格",
         command=add_from_csv,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=9,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=9, row=a_y)
     tkinter.Button(
         SCREEN,
-        text='生成表格',
+        text="生成表格",
         command=func_to_sheet,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=10,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=10, row=a_y)
     tkinter.Button(
         SCREEN,
-        text='导出表格',
+        text="导出表格",
         command=func_to_csv,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=11,
-        row=a_y)
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=11, row=a_y)
 
     a_y += 1
     # 显示函数的xy
-    sheet_box = tkinter.Listbox(SCREEN, width=width_B * 3 + 2)  # 暂时不启用多选
+    sheet_box = tkinter.Listbox(SCREEN, width=gui_width * 3 + 2)  # 暂时不启用多选
     sheet_box.grid(
         column=9,
         row=a_y,
         columnspan=3,
-        rowspan=TD_a_y +
-        4,
-        sticky=tkinter.S +
-        tkinter.N +
-        tkinter.E +
-        tkinter.W)
-
-    output_prompt('加载完成,欢迎使用!')
+        rowspan=rowspan + 4,
+        sticky=tkinter.S + tkinter.N + tkinter.E + tkinter.W,
+    )
+
+    output_prompt("加载完成,欢迎使用!")
     SCREEN.mainloop()

Diff do ficheiro suprimidas por serem muito extensas
+ 321 - 356
HSCH/Func_advanced.py


Diff do ficheiro suprimidas por serem muito extensas
+ 269 - 206
HSCH/HS.py


+ 4 - 4
Hello.py

@@ -57,8 +57,8 @@ def Dsgc():
 
 
 def Machine_Learning():
-    from Machine_learning_analysis import Main
-    Main()
+    from Machine_learning_analysis import machine_learning
+    machine_learning()
 
 
 def MLA():
@@ -79,8 +79,8 @@ def GIT_Ctrl():
 
 
 def Crawler_Main():
-    from Crawler import Main
-    Main()
+    from Crawler import crawler_main
+    crawler_main()
 
 
 def Crawlef_Run():

Diff do ficheiro suprimidas por serem muito extensas
+ 421 - 413
Machine_learning_analysis/Learn_Numpy.py


+ 2001 - 2286
Machine_learning_analysis/Machine_learning.py

@@ -8,2583 +8,2298 @@ from tkinter.scrolledtext import ScrolledText
 from Machine_learning_analysis import Learn_Numpy
 
 
-def Main():
-    global top, ML, Form_List, PATH, bg, bbg, fg, Merge_list, Cul_list, Cul_Type
-    Cul_list = []
-    Cul_Type = []
+def machine_learning():
+    global SCREEN, learner_controller, sheet_list, PATH, bg_color, botton_color, word_color
+    global merge_list, calculation_list, calculation_method, FONT
+    calculation_list = []
+    calculation_method = []
     PATH = os.getcwd()
-    Form_List = []
-    Merge_list = []
-    ML = Learn_Numpy.Machine_Learner()
-
-    top = tkinter.Tk()
-    bg = '#FFFAFA'  # 主颜色
-    bbg = '#FFFAFA'  # 按钮颜色
-    fg = '#000000'  # 文字颜色
-    top["bg"] = bg
-    FONT = ('黑体', 11)  # 设置字体
-    top.title('CoTan机器学习')
-    top.resizable(width=False, height=False)
-    top.geometry('+10+10')  # 设置所在位置
-
-    width_B = 13  # 标准宽度
-    height_B = 2
-    a_y = 0
-    a_x = 0
-
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='导入CSV',
-        command=Add_CSV,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='导入Py',
-        command=Add_Python,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='导出CSV',
-        command=to_CSV,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    global name_Input
-    a_y += 1
+    sheet_list = []
+    merge_list = []
+    learner_controller = Learn_Numpy.MachineLearner()
+
+    SCREEN = tkinter.Tk()
+    bg_color = "#FFFAFA"  # 主颜色
+    botton_color = "#FFFAFA"  # 按钮颜色
+    word_color = "#000000"  # 文字颜色
+    SCREEN["bg"] = bg_color
+    FONT = ("黑体", 11)  # 设置字体
+    SCREEN.title("CoTan机器学习")
+    SCREEN.resizable(width=False, height=False)
+    SCREEN.geometry("+10+10")  # 设置所在位置
+
+    gui_width = 13  # 标准宽度
+    gui_height = 2
+    row = 0
+    column = 0
+
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="导入CSV",
+        command=add_csv,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="导入Py",
+        command=add_python,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="导出CSV",
+        command=to_csv,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    global sheet_name
+    row += 1
     tkinter.Label(
-        top,
-        text='表格名称:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)  # 设置说明
-    name_Input = tkinter.Entry(top, width=width_B)
-    name_Input.grid(
-        column=a_x +
-        1,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='删除表格',
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='查看表格',
-        command=Show,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='查看单一表格',
-        command=Show_One,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    global Form_BOX, Index_BOX, Column_BOX, to_HTML_Type, Seq_Input, Code_Input, str_must
-    a_y += 1
-    to_HTML_Type = tkinter.IntVar()  # 正,负,0
-    lable = ['选项卡型', '可移动型', '自适应型']  # 复选框
+        SCREEN,
+        text="表格名称:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column, row=row
+    )  # 设置说明
+    sheet_name = tkinter.Entry(SCREEN, width=gui_width)
+    sheet_name.grid(
+        column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="删除表格",
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="查看表格",
+        command=to_html,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="查看单一表格",
+        command=to_html_one,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    global sheet_box, index_box, column_box, to_html_type, sep, encoding, dtype_str
+    row += 1
+    to_html_type = tkinter.IntVar()  # 正,负,0
+    lable = ["选项卡型", "可移动型", "自适应型"]  # 复选框
     for i in range(3):
         tkinter.Radiobutton(
-            top,
-            bg=bg,
-            fg=fg,
-            activebackground=bg,
-            activeforeground=fg,
-            selectcolor=bg,
+            SCREEN,
+            bg=bg_color,
+            fg=word_color,
+            activebackground=bg_color,
+            activeforeground=word_color,
+            selectcolor=bg_color,
             text=lable[i],
-            variable=to_HTML_Type,
-            value=i).grid(
-            column=a_x + i,
-            row=a_y,
-            sticky=tkinter.W)
-
-    str_must = tkinter.IntVar()
-    a_y += 1
+            variable=to_html_type,
+            value=i,
+        ).grid(column=column + i, row=row, sticky=tkinter.W)
+
+    dtype_str = tkinter.IntVar()
+    row += 1
     tkinter.Label(
-        top,
-        text='编码方式:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)  # 设置说明
-    Code_Input = tkinter.Entry(top, width=width_B)
-    Code_Input.grid(column=a_x + 1, row=a_y, sticky=tkinter.E + tkinter.W)
+        SCREEN,
+        text="编码方式:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column, row=row
+    )  # 设置说明
+    encoding = tkinter.Entry(SCREEN, width=gui_width)
+    encoding.grid(column=column + 1, row=row, sticky=tkinter.E + tkinter.W)
     buttom = tkinter.Checkbutton(
-        top,
-        bg=bg,
-        fg=fg,
-        activebackground=bg,
-        activeforeground=fg,
-        selectcolor=bg,
-        text='字符串类型',
-        variable=str_must)
-    buttom.grid(column=a_x + 2, row=a_y, sticky=tkinter.W)
-
-    a_y += 1
+        SCREEN,
+        bg=bg_color,
+        fg=word_color,
+        activebackground=bg_color,
+        activeforeground=word_color,
+        selectcolor=bg_color,
+        text="字符串类型",
+        variable=dtype_str,
+    )
+    buttom.grid(column=column + 2, row=row, sticky=tkinter.W)
+
+    row += 1
     tkinter.Label(
-        top,
-        text='CSV分隔符:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)  # 设置说明
-    Seq_Input = tkinter.Entry(top, width=width_B)
-    Seq_Input.grid(
-        column=a_x +
-        1,
-        columnspan=2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    a_y += 1
-    Form_BOX = tkinter.Listbox(
-        top,
-        width=width_B *
-        3,
-        height=height_B *
-        10)  # 显示符号
-    Form_BOX.grid(
-        column=a_x,
-        row=a_y,
+        SCREEN,
+        text="CSV分隔符:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column, row=row
+    )  # 设置说明
+    sep = tkinter.Entry(SCREEN, width=gui_width)
+    sep.grid(column=column + 1, columnspan=2, row=row, sticky=tkinter.E + tkinter.W)
+
+    row += 1
+    sheet_box = tkinter.Listbox(
+        SCREEN, width=gui_width * 3, height=gui_height * 10
+    )  # 显示符号
+    sheet_box.grid(
+        column=column,
+        row=row,
         columnspan=3,
         rowspan=10,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
+    )
     # 422
-    a_y += 10
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='添加数据',
-        command=Merge_Add,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='删除数据',
-        command=Merge_Del,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='组合数据',
-        command=Merge,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    global Processing_type, Shape_Input, Merge_BOX
-    a_y += 1
-    Merge_BOX = tkinter.Listbox(
-        top,
-        width=width_B *
-        3,
-        height=height_B *
-        3)  # 显示符号
-    Merge_BOX.grid(
-        column=a_x,
-        row=a_y,
+    row += 10
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="添加数据",
+        command=merge_add,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="删除数据",
+        command=merge_del,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="组合数据",
+        command=merge,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    global processing_type, shape, merge_box
+    row += 1
+    merge_box = tkinter.Listbox(
+        SCREEN, width=gui_width * 3, height=gui_height * 3
+    )  # 显示符号
+    merge_box.grid(
+        column=column,
+        row=row,
         columnspan=3,
         rowspan=3,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 3
-    Processing_type = tkinter.IntVar()  # 正,负,0
-    lable = ['横向处理', '纵向处理', '深度处理']  # 复选框
+        sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 3
+    processing_type = tkinter.IntVar()  # 正,负,0
+    lable = ["横向处理", "纵向处理", "深度处理"]  # 复选框
     for i in range(3):
         tkinter.Radiobutton(
-            top,
-            bg=bg,
-            fg=fg,
-            activebackground=bg,
-            activeforeground=fg,
-            selectcolor=bg,
+            SCREEN,
+            bg=bg_color,
+            fg=word_color,
+            activebackground=bg_color,
+            activeforeground=word_color,
+            selectcolor=bg_color,
             text=lable[i],
-            variable=Processing_type,
-            value=i).grid(
-            column=a_x + i,
-            row=a_y,
-            sticky=tkinter.W)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数据切片',
-        command=Two_Split,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数据分割',
-        command=Split,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
+            variable=processing_type,
+            value=i,
+        ).grid(column=column + i, row=row, sticky=tkinter.W)
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数据切片",
+        command=two_split,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数据分割",
+        command=split,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
         columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
 
-    a_y += 1
-    tkinter.Label(
-        top,
-        text='重塑形状:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)
-    Shape_Input = tkinter.Entry(top, width=width_B)
-    Shape_Input.grid(column=a_x + 1, row=a_y, sticky=tkinter.E + tkinter.W)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵重塑',
-        command=Reshape,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵伸展',
-        command=Reval,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵降维',
-        command=Del_Ndim,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵转置',
-        command=T,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_x += 3
+    row += 1
     tkinter.Label(
-        top,
-        text='',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=1).grid(
-        column=a_x,
-        row=a_y)  # 设置说明
-    a_x += 1
-    a_y = 0
+        SCREEN,
+        text="重塑形状:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column, row=row)
+    shape = tkinter.Entry(SCREEN, width=gui_width)
+    shape.grid(column=column + 1, row=row, sticky=tkinter.E + tkinter.W)
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵重塑",
+        command=reshape,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵伸展",
+        command=reval,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵降维",
+        command=del_ndim,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵转置",
+        command=transpose,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    column += 3
+    tkinter.Label(SCREEN, text="", bg=bg_color, fg=word_color, font=FONT, width=1).grid(
+        column=column, row=row
+    )  # 设置说明
+    column += 1
+    row = 0
 
     tkinter.Label(
-        top,
-        text='【机器学习】',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B *
-        3,
-        height=height_B).grid(
-        column=a_x,
+        SCREEN,
+        text="【机器学习】",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width * 3,
+        height=gui_height,
+    ).grid(
+        column=column,
         columnspan=3,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)  # 设置说明
-
-    global ML_BOX, ML_OUT, X_OUT, Y_OUT
-    a_y += 1
-    X_OUT = tkinter.StringVar()
-    Put = tkinter.Entry(top, width=width_B * 2, textvariable=X_OUT)
-    Put.grid(column=a_x, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
-    Put['state'] = 'readonly'
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='选用X集',
-        command=set_Feature,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    Y_OUT = tkinter.StringVar()
-    a_y += 1
-    Put = tkinter.Entry(top, width=width_B * 2, textvariable=Y_OUT)
-    Put.grid(column=a_x, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
-    Put['state'] = 'readonly'
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='选用Y集',
-        command=set_Label,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    ML_OUT = tkinter.StringVar()
-    a_y += 1
-    Put = tkinter.Entry(top, width=width_B * 2, textvariable=ML_OUT)
-    Put.grid(column=a_x, row=a_y, columnspan=2, sticky=tkinter.E + tkinter.W)
-    Put['state'] = 'readonly'
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='选用学习器',
-        command=set_Learner,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    global Split_Input
-    a_y += 1
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )  # 设置说明
+
+    global learner_box, learner_output, x_data, y_data
+    row += 1
+    x_data = tkinter.StringVar()
+    put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=x_data)
+    put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
+    put["state"] = "readonly"
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="选用X集",
+        command=set_x_data,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
+
+    y_data = tkinter.StringVar()
+    row += 1
+    put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=y_data)
+    put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
+    put["state"] = "readonly"
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="选用Y集",
+        command=set_y_data,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
+
+    learner_output = tkinter.StringVar()
+    row += 1
+    put = tkinter.Entry(SCREEN, width=gui_width * 2, textvariable=learner_output)
+    put.grid(column=column, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
+    put["state"] = "readonly"
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="选用学习器",
+        command=set_learner,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column + 2, row=row, sticky=tkinter.E + tkinter.W)
+
+    global data_split
+    row += 1
     tkinter.Label(
-        top,
-        text='测试数据分割:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)
-    Split_Input = tkinter.Entry(top, width=width_B * 2)
-    Split_Input.grid(
-        column=a_x +
-        1,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    a_y += 1
-    ML_BOX = tkinter.Listbox(top, width=width_B * 3, height=height_B * 5)
-    ML_BOX.grid(
-        column=a_x,
-        row=a_y,
+        SCREEN,
+        text="测试数据分割:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column, row=row)
+    data_split = tkinter.Entry(SCREEN, width=gui_width * 2)
+    data_split.grid(
+        column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
+    )
+
+    row += 1
+    learner_box = tkinter.Listbox(SCREEN, width=gui_width * 3, height=gui_height * 5)
+    learner_box.grid(
+        column=column,
+        row=row,
         columnspan=3,
         rowspan=5,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 5
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='导入学习器',
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='查看数据',
-        command=Show_Args,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='删除学习器',
-        command=Del_Leaner,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='训练机器',
-        command=Fit_Learner,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='测试机器',
-        command=Score_Learner,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数据预测',
-        command=Predict_Learner,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='单一变量特征选择',
-        command=Add_SelectKBest,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
+        sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 5
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="导入学习器",
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="查看数据",
+        command=visualization_results,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="删除学习器",
+        command=del_leaner,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="训练机器",
+        command=fit_learner,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="测试机器",
+        command=score_learner,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数据预测",
+        command=predict_learner,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="单一变量特征选择",
+        command=add_select_k_best,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
         columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='映射标准化',
-        command=Add_Mapzoom,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='方差特征选择',
-        command=Add_Variance,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='使用学习器筛选',
-        command=Add_SelectFrom_Model,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='模糊量化标准化',
-        command=Add_Fuzzy_quantization,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='Z-score',
-        command=Add_Z_Score,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='离差标准化',
-        command=Add_MinMaxScaler,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='Log变换',
-        command=Add_LogScaler,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='atan变换',
-        command=Add_atanScaler,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='小数定标准化',
-        command=Add_decimalScaler,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='Sigmod变换',
-        command=Add_sigmodScaler,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='正则化',
-        command=Add_Regularization,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='二值离散',
-        command=Add_Binarizer,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='多值离散',
-        command=Add_Discretization,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='独热编码',
-        command=Add_OneHotEncoder,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数字编码',
-        command=Add_Label,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='缺失填充',
-        command=Add_Missed,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='PCA降维',
-        command=Add_PCA,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='RPCA降维',
-        command=Add_RPCA,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='KPCA升维',
-        command=Add_KPCA,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='LDA降维',
-        command=Add_LDA,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='NMF降维',
-        command=Add_NMF,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='t-SNE',
-        command=Add_TSNE,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='线性回归',
-        command=Add_Line,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='岭回归',
-        command=Add_Ridge,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='Lasso',
-        command=Add_Lasso,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='逻辑回归',
-        command=Add_LogisticRegression,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='K邻近预测',
-        command=Add_Knn,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='K邻近分类',
-        command=Add_Knn_Class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='梯度回归树回归',
-        command=Add_GradientTree,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='决策树回归',
-        command=Add_Tree,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='决策树分类',
-        command=Add_Tree_Class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='梯度回归树分类',
-        command=Add_GradientTree_class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='随机森林回归',
-        command=Add_Forest,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='随机森林分类',
-        command=Add_Forest_class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_x += 3
-    tkinter.Label(
-        top,
-        text='',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=1).grid(
-        column=a_x,
-        row=a_y)  # 设置说明
-    a_x += 1
-    a_y = 0
-
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='多层感知机回归',
-        command=Add_MLP,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='多层感知机分类',
-        command=Add_MLP_class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='随机森林分类',
-        command=Add_Forest_class,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='支持向量机分类:SVC',
-        command=Add_SVC,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="映射标准化",
+        command=add_mapzoom,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="方差特征选择",
+        command=add_variance,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="使用学习器筛选",
+        command=add_select_from_model,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="模糊量化标准化",
+        command=add_fuzzy_quantization,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="Z-score",
+        command=add_z_score,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="离差标准化",
+        command=add_min_max_scaler,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="Log变换",
+        command=add_log_scaler,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="atan变换",
+        command=add_atan_scaler,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="小数定标准化",
+        command=add_decimal_scaler,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="Sigmod变换",
+        command=add_sigmod_scaler,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="正则化",
+        command=add_regularization,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="二值离散",
+        command=add_binarizer,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="多值离散",
+        command=add_discretization,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="独热编码",
+        command=add_one_hot_encoder,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数字编码",
+        command=add_label,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="缺失填充",
+        command=add_missed,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="PCA降维",
+        command=add_pca,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="RPCA降维",
+        command=add_rpca,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="KPCA升维",
+        command=add_kpca,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="LDA降维",
+        command=add_lda,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="NMF降维",
+        command=add_nmf,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="t-SNE",
+        command=add_tsne,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="线性回归",
+        command=add_line,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="岭回归",
+        command=add_ridge,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="Lasso",
+        command=add_lasso,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="逻辑回归",
+        command=add_logistic_regression,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="K邻近预测",
+        command=add_knn,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="K邻近分类",
+        command=add_knn_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="梯度回归树回归",
+        command=add_gradient_tree,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="决策树回归",
+        command=add_tree,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="决策树分类",
+        command=add_tree_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="梯度回归树分类",
+        command=add_gradient_tree_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="随机森林回归",
+        command=add_forest,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="随机森林分类",
+        command=add_forest_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    column += 3
+    tkinter.Label(SCREEN, text="", bg=bg_color, fg=word_color, font=FONT, width=1).grid(
+        column=column, row=row
+    )  # 设置说明
+    column += 1
+    row = 0
+
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="多层感知机回归",
+        command=add_mlp,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="多层感知机分类",
+        command=add_mlp_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="随机森林分类",
+        command=add_forest_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="支持向量机分类:SVC",
+        command=add_svc,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
         columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='回归:SVR',
-        command=Add_SVR,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='k-means',
-        command=Add_KMeans,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='凝聚聚类',
-        command=Add_Agglomerative,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='DBSCAN',
-        command=Add_DBSCAN,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='特征分类图',
-        command=Add_ClassBar,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='临近特征回归图',
-        command=Add_FeatureScatter,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='临近特征分类图',
-        command=Add_FeatureScatterClass,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='所有特征回归图',
-        command=Add_FeatureScatter_all,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='所有特征分类图',
-        command=Add_FeatureScatterClass_all,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='临近特征预测图',
-        command=Add_Predictive_HeatMap,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='所有特征预测图',
-        command=Add_Predictive_HeatMap_More,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵热力图',
-        command=Add_Numpy_To_HeatMap,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数据y-x散点图',
-        command=Add_FeatureY_X,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='聚类树状图',
-        command=Add_ClusterTree,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='获取数据',
-        command=Add_View_data,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵散点图',
-        command=Add_MatrixScatter,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='特征相关性',
-        command=Add_corr,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='曲线拟合',
-        command=Curve_fitting,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='快速傅里叶',
-        command=Add_Fast_Fourier,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='数据统计',
-        command=Add_Des,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='双逆向傅里叶',
-        command=Add_Reverse_Fast_Fourier2,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='逆向傅里叶',
-        command=Add_Reverse_Fast_Fourier,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='分类模型评估',
-        command=Show_Class_Score,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='回归模型评估',
-        command=Show_Regression_Score,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-    tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='聚类模型评估',
-        command=Show_Clustering_Score,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
-
-    a_y += 1
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="回归:SVR",
+        command=add_svr,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="k-means",
+        command=add_k_means,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="凝聚聚类",
+        command=add_agglomerative,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="DBSCAN",
+        command=add_dbscan,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="特征分类图",
+        command=add_class_bar,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="临近特征回归图",
+        command=add_feature_scatter,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="临近特征分类图",
+        command=add_feature_scatter_class,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="所有特征回归图",
+        command=add_feature_scatter_all,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="所有特征分类图",
+        command=add_feature_scatter_class_all,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="临近特征预测图",
+        command=add_predictive_heatmap,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="所有特征预测图",
+        command=add_predictive_heatmap_more,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵热力图",
+        command=add_numpy_to_heatmap,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数据y-x散点图",
+        command=add_feature_y_x,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="聚类树状图",
+        command=add_cluster_tree,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="获取数据",
+        command=add_view_data,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵散点图",
+        command=add_matrix_scatter,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="特征相关性",
+        command=add_correlation,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="曲线拟合",
+        command=curve_fitting,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="快速傅里叶",
+        command=add_fast_fourier,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="数据统计",
+        command=add_statistics,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="双逆向傅里叶",
+        command=add_reverse_fast_fourier2,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="逆向傅里叶",
+        command=add_reverse_fast_fourier,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="分类模型评估",
+        command=show_class_score,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="回归模型评估",
+        command=show_regression_score,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+    tkinter.Button(
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="聚类模型评估",
+        command=show_clustering_score,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
+
+    row += 1
     tkinter.Label(
-        top,
-        text='【学习器配置】',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B *
-        3,
-        height=height_B).grid(
-        column=a_x,
+        SCREEN,
+        text="【学习器配置】",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width * 3,
+        height=gui_height,
+    ).grid(
+        column=column,
         columnspan=3,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)  # 设置说明
-
-    global Global_Type
-    a_y += 1
-    Global_Type = []
-    lable = ['聚类仅邻近特征', '导出单独页面', '导出表格CSV']  # 复选框
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )  # 设置说明
+
+    global global_settings
+    row += 1
+    global_settings = []
+    lable = ["聚类仅邻近特征", "导出单独页面", "导出表格CSV"]  # 复选框
     for i in range(3):
-        Global_Type.append(tkinter.IntVar())
-        tkinter.Checkbutton(top,
-                            bg=bg,
-                            fg=fg,
-                            activebackground=bg,
-                            activeforeground=fg,
-                            selectcolor=bg,
-                            text=lable[i],
-                            variable=Global_Type[-1],
-                            command=globalSeeting).grid(column=a_x + i,
-                                                        row=a_y,
-                                                        sticky=tkinter.W)
-
-    a_y += 1
-    lable = ['导出模型', '压缩为tar.gz', '创建新目录']  # 复选框
+        global_settings.append(tkinter.IntVar())
+        tkinter.Checkbutton(
+            SCREEN,
+            bg=bg_color,
+            fg=word_color,
+            activebackground=bg_color,
+            activeforeground=word_color,
+            selectcolor=bg_color,
+            text=lable[i],
+            variable=global_settings[-1],
+            command=global_seeting,
+        ).grid(column=column + i, row=row, sticky=tkinter.W)
+
+    row += 1
+    lable = ["导出模型", "压缩为tar.gz", "创建新目录"]  # 复选框
     for i in range(3):
-        Global_Type.append(tkinter.IntVar())
-        tkinter.Checkbutton(top,
-                            bg=bg,
-                            fg=fg,
-                            activebackground=bg,
-                            activeforeground=fg,
-                            selectcolor=bg,
-                            text=lable[i],
-                            variable=Global_Type[-1],
-                            command=globalSeeting).grid(column=a_x + i,
-                                                        row=a_y,
-                                                        sticky=tkinter.W)
-
-    for i in Global_Type[1:]:
-        i.set(1)
-    globalSeeting()
+        global_settings.append(tkinter.IntVar())
+        tkinter.Checkbutton(
+            SCREEN,
+            bg=bg_color,
+            fg=word_color,
+            activebackground=bg_color,
+            activeforeground=word_color,
+            selectcolor=bg_color,
+            text=lable[i],
+            variable=global_settings[-1],
+            command=global_seeting,
+        ).grid(column=column + i, row=row, sticky=tkinter.W)
 
-    global Args_Learner
-    a_y += 1
-    Args_Learner = tkinter.Text(top, width=width_B * 3, height=height_B * 6)
-    Args_Learner.grid(column=a_x, row=a_y, columnspan=3, rowspan=6,
-                      sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S)
+    for i in global_settings[1:]:
+        i.set(1)
+    global_seeting()
+
+    global learner_parameters
+    row += 1
+    learner_parameters = tkinter.Text(
+        SCREEN, width=gui_width * 3, height=gui_height * 6
+    )
+    learner_parameters.grid(
+        column=column,
+        row=row,
+        columnspan=3,
+        rowspan=6,
+        sticky=tkinter.E + tkinter.W + tkinter.N + tkinter.S,
+    )
 
-    a_y += 6
+    row += 6
     tkinter.Label(
-        top,
-        text='【矩阵运算】',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B *
-        3,
-        height=height_B).grid(
-        column=a_x,
+        SCREEN,
+        text="【矩阵运算】",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width * 3,
+        height=gui_height,
+    ).grid(
+        column=column,
         columnspan=3,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)  # 设置说明
-
-    global Cul_Box, CulType_Input, Value_Input
-    a_y += 1
-    Cul_Box = tkinter.Listbox(top, width=width_B * 3, height=height_B * 1)
-    Cul_Box.grid(
-        column=a_x,
-        row=a_y,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )  # 设置说明
+
+    global calculation_box, calculation_type, value
+    row += 1
+    calculation_box = tkinter.Listbox(
+        SCREEN, width=gui_width * 3, height=gui_height * 1
+    )
+    calculation_box.grid(
+        column=column,
+        row=row,
         columnspan=3,
         rowspan=1,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        sticky=tkinter.E + tkinter.W + tkinter.S + tkinter.N,
+    )
 
-    a_y += 1
+    row += 1
     tkinter.Label(
-        top,
-        text='运算类型:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)
-    CulType_Input = tkinter.Entry(top, width=width_B * 2)
-    CulType_Input.grid(
-        column=a_x +
-        1,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
-
-    a_y += 1
+        SCREEN,
+        text="运算类型:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column, row=row)
+    calculation_type = tkinter.Entry(SCREEN, width=gui_width * 2)
+    calculation_type.grid(
+        column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W
+    )
+
+    row += 1
     tkinter.Label(
-        top,
-        text='键入参数:',
-        bg=bg,
-        fg=fg,
-        font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y)
-    Value_Input = tkinter.Entry(top, width=width_B * 2)
-    Value_Input.grid(
-        column=a_x +
-        1,
-        row=a_y,
-        columnspan=2,
-        sticky=tkinter.E +
-        tkinter.W)
+        SCREEN,
+        text="键入参数:",
+        bg=bg_color,
+        fg=word_color,
+        font=FONT,
+        width=gui_width,
+        height=gui_height,
+    ).grid(column=column, row=row)
+    value = tkinter.Entry(SCREEN, width=gui_width * 2)
+    value.grid(column=column + 1, row=row, columnspan=2, sticky=tkinter.E + tkinter.W)
 
-    a_y += 1
+    row += 1
     tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='选择参数',
-        command=Cul_Add,
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="选择参数",
+        command=add_calculation_object,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
     tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='键入参数',
-        command=Cul_Input,
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="键入参数",
+        command=add_calculation_number,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        1,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 1,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
     tkinter.Button(
-        top,
-        bg=bbg,
-        fg=fg,
-        text='矩阵运算',
-        command=Cul_Numpy,
+        SCREEN,
+        bg=botton_color,
+        fg=word_color,
+        text="矩阵运算",
+        command=calculation,
         font=FONT,
-        width=width_B,
-        height=height_B).grid(
-        column=a_x +
-        2,
-        row=a_y,
-        sticky=tkinter.E +
-        tkinter.W +
-        tkinter.W +
-        tkinter.S +
-        tkinter.N)
+        width=gui_width,
+        height=gui_height,
+    ).grid(
+        column=column + 2,
+        row=row,
+        sticky=tkinter.E + tkinter.W + tkinter.W + tkinter.S + tkinter.N,
+    )
 
-    top.mainloop()
+    SCREEN.mainloop()
 
 
-def Add_Reverse_Fast_Fourier2():  # 添加Lenear的核心
-    Add_leaner('[2]Reverse_Fast_Fourier')
+def add_reverse_fast_fourier2():  # 添加Lenear的核心
+    add_leaner("[2]Reverse_Fast_Fourier")
 
 
-def Add_Reverse_Fast_Fourier():  # 添加Lenear的核心
-    Add_leaner('Reverse_Fast_Fourier')
+def add_reverse_fast_fourier():  # 添加Lenear的核心
+    add_leaner("Reverse_Fast_Fourier")
 
 
-def Add_Fast_Fourier():  # 添加Lenear的核心
-    Add_leaner('Fast_Fourier')
+def add_fast_fourier():  # 添加Lenear的核心
+    add_leaner("Fast_Fourier")
 
 
-def Curve_fitting():
-    Dic = askopenfilename(title='导入参数')
-    with open(Dic, 'r') as f:
-        ML.Add_Curve_Fitting(f.read(), Text=get_Args_Learner())
-        Update_Leaner()
+def curve_fitting():
+    file_dir = askopenfilename(title="导入参数")
+    with open(file_dir, "r") as f:
+        learner_controller.add_curve_fitting(f.read())
+        update_leaner()
 
 
-def Show_Clustering_Score():
-    Show_Score(2)
+def show_clustering_score():
+    show_score(2)
 
 
-def Show_Regression_Score():
-    Show_Score(1)
+def show_regression_score():
+    show_score(1)
 
 
-def Show_Class_Score():
-    Show_Score(0)
+def show_class_score():
+    show_score(0)
 
 
-def Show_Score(func):
-    learner = get_Learner(True)
-    Dic = askdirectory(title='选择保存位置')
-    data = ML.Show_Score(
-        learner, Dic, get_Name(
-            False, True), get_Name(
-            False, False), func)
+def show_score(func):
+    learner = get_learner(True)
+    save_dir = askdirectory(title="选择保存位置")
+    data = learner_controller.model_evaluation(
+        learner, save_dir, get_name(False, True), get_name(False, False), func
+    )
     webbrowser.open(data[0])
     webbrowser.open(data[1])  # 还可以打开文件管理器
-    Update_BOX()
+    update_sheet_box()
 
 
-def Cul_Numpy():
-    global Cul_list, Cul_Type, CulType_Input
-    func = CulType_Input.get()
-    if len(Cul_list) == 2 and 1 in Cul_Type:
-        ML.Cul_Numpy(Cul_list, Cul_Type, func)
-    Update_BOX()
+def calculation():
+    global calculation_list, calculation_method, calculation_type
+    func = calculation_type.get()
+    if len(calculation_list) == 2 and 1 in calculation_method:
+        learner_controller.calculation_matrix(
+            calculation_list, calculation_method, func
+        )
+    update_sheet_box()
 
 
-def Add_Cul(num, type_):
-    global Cul_list, Cul_Type
-    if len(Cul_list) == 2:
-        del Cul_list[0]
-        del Cul_Type[0]
-    Cul_list.append(num)
-    Cul_Type.append(type_)
+def add_calculation_core(num, type_):
+    global calculation_list, calculation_method
+    if len(calculation_list) == 2:
+        del calculation_list[0]
+        del calculation_method[0]
+    calculation_list.append(num)
+    calculation_method.append(type_)
 
 
-def Update_Cul():
-    global Cul_list, Cul_Type, Cul_Box
-    Cul_Box.delete(0, tkinter.END)
-    a = ['第一参数', '第二参数']
-    b = ['参数', '矩阵']
-    Cul_Box.insert(
-        tkinter.END, *[f'{a[i]} {Cul_list[i]} {b[Cul_Type[i]]}' for i in range(len(Cul_list))])
+def update_calculation_box():
+    global calculation_list, calculation_method, calculation_box
+    calculation_box.delete(0, tkinter.END)
+    a = ["第一参数", "第二参数"]
+    b = ["参数", "矩阵"]
+    calculation_box.insert(
+        tkinter.END,
+        *[
+            f"{a[i]} {calculation_list[i]} {b[calculation_method[i]]}"
+            for i in range(len(calculation_list))
+        ],
+    )
 
 
-def Cul_Input():
-    global Cul_Box, CulType_Input, Value_Input
-    num = eval(Value_Input.get(), {})
-    Add_Cul(num, 0)
-    Update_Cul()
+def add_calculation_number():
+    global calculation_box, calculation_type, value
+    num = eval(value.get(), {})
+    add_calculation_core(num, 0)
+    update_calculation_box()
 
 
-def Cul_Add():
-    name = get_Name()
-    Add_Cul(name, 1)
-    Update_Cul()
+def add_calculation_object():
+    name = get_name()
+    add_calculation_core(name, 1)
+    update_calculation_box()
 
 
-def Del_Leaner():
-    Learn = get_Learner(True)
-    set_Learne = get_Learner(False)  # 获取学习器Learner
-    if set_Learne != Learn:
-        ML.Del_Leaner(Learn)
-    Update_Leaner()
+def del_leaner():
+    learn = get_learner(True)
+    set_learne = get_learner(False)  # 获取学习器Learner
+    if set_learne != learn:
+        learner_controller.del_leaner(learn)
+    update_leaner()
 
 
-def globalSeeting():
-    global Global_Type
-    args = [bool(i.get()) for i in Global_Type]
-    Learn_Numpy.set_Global(*args)
+def global_seeting():
+    global global_settings
+    args = [bool(i.get()) for i in global_settings]
+    Learn_Numpy.set_global(*args)
 
 
-def Reshape():
-    global ML, Processing_type
-    shape = eval(f'[{Shape_Input.get()}]')[0]
-    ML.reShape(get_Name(), shape)
-    Update_BOX()
+def reshape():
+    global learner_controller, processing_type, shape
+    numpy_shape = eval(f"[{shape.get()}]")[0]
+    learner_controller.reshape(get_name(), numpy_shape)
+    update_sheet_box()
 
 
-def T():
-    global ML, Processing_type, Shape_Input
+def transpose():
+    global learner_controller, processing_type, shape
     try:
-        Func = eval(f'[{Shape_Input.get()}]')
+        func = eval(f"[{shape.get()}]")
     except BaseException:
-        Func = None
-    ML.transpose(get_Name(), Func)
-    Update_BOX()
+        func = None
+    learner_controller.transpose(get_name(), func)
+    update_sheet_box()
 
 
-def Del_Ndim():
-    global ML
-    ML.Del_Ndim(get_Name())
-    Update_BOX()
+def del_ndim():
+    global learner_controller
+    learner_controller.del_ndim(get_name())
+    update_sheet_box()
 
 
-def Reval():
-    global ML, Processing_type
-    Type = Processing_type.get()
-    ML.Reval(get_Name(), Type)
-    Update_BOX()
+def reval():
+    global learner_controller, processing_type
+    reval_type = processing_type.get()
+    learner_controller.reval(get_name(), reval_type)
+    update_sheet_box()
 
 
-def Two_Split():
-    global ML, Processing_type, Shape_Input
-    Type = Processing_type.get()
-    ML.Two_Split(get_Name(), Shape_Input.get(), Type)
-    Update_BOX()
+def two_split():
+    global learner_controller, processing_type, shape
+    split_type = processing_type.get()
+    learner_controller.two_split(get_name(), shape.get(), split_type)
+    update_sheet_box()
 
 
-def Split():
-    global ML, Processing_type, Shape_Input
-    Type = Processing_type.get()
+def split():
+    global learner_controller, processing_type, shape
+    split_type = processing_type.get()
     try:
-        Split = eval(f'[{Shape_Input.get()}]')[0]
+        split_shape_list = eval(f"[{shape.get()}]", {})[0]
     except BaseException:
-        Split = 2
-    ML.Split(get_Name(), Split, Type)
-    Update_BOX()
+        split_shape_list = 2
+    learner_controller.split(get_name(), split_shape_list, split_type)
+    update_sheet_box()
 
 
-def Merge():
-    global Merge_list, ML, Processing_type
-    if len(Merge_list) < 1:
+def merge():
+    global merge_list, learner_controller, processing_type
+    if len(merge_list) < 1:
         return False
-    Type = Processing_type.get()
-    ML.Merge(Merge_list, Type)
-    Update_BOX()
+    merge_type = processing_type.get()
+    learner_controller.merge(merge_list, merge_type)
+    update_sheet_box()
 
 
-def Update_Merge():
-    global Merge_list, Merge_BOX
-    Merge_BOX.delete(0, tkinter.END)
-    Merge_BOX.insert(tkinter.END, *Merge_list)
+def update_merge_box():
+    global merge_list, merge_box
+    merge_box.delete(0, tkinter.END)
+    merge_box.insert(tkinter.END, *merge_list)
 
 
-def Merge_Del():
-    global Merge_list, Merge_BOX
-    del Merge_list[Merge_BOX.curselection()[0]]
-    Update_Merge()
+def merge_del():
+    global merge_list, merge_box
+    del merge_list[merge_box.curselection()[0]]
+    update_merge_box()
 
 
-def Merge_Add():
-    global Merge_list
-    name = get_Name()
-    Merge_list.append(name)
-    Update_Merge()
+def merge_add():
+    global merge_list
+    name = get_name()
+    merge_list.append(name)
+    update_merge_box()
 
 
-def Show_Args():
-    learner = get_Learner(True)
-    Dic = askdirectory(title='选择保存位置')
-    data = ML.Show_Args(learner, Dic)
+def visualization_results():
+    learner = get_learner(True)
+    save_dir = askdirectory(title="选择保存位置")
+    data = learner_controller.model_visualization(learner, save_dir)
     webbrowser.open(data[0])
     webbrowser.open(data[1])  # 还可以打开文件管理器
-    Update_BOX()
+    update_sheet_box()
 
 
-def get_Args_Learner():
-    global Args_Learner
-    return Args_Learner.get('0.0', tkinter.END)
+def get_learner_parameters():
+    global learner_parameters
+    return learner_parameters.get("0.0", tkinter.END)
 
 
-def Score_Learner():
-    learner = get_Learner()
-    socore = ML.Score(get_Name(False, True), get_Name(False, False), learner)
-    tkinter.messagebox.showinfo('测试完成', f'针对测试数据评分结果为:{socore}')
+def score_learner():
+    learner = get_learner()
+    socore = learner_controller.score(
+        get_name(False, True), get_name(False, False), learner
+    )
+    tkinter.messagebox.showinfo("测试完成", f"针对测试数据评分结果为:{socore}")
 
 
-def Predict_Learner():
-    learner = get_Learner()
-    Data = ML.Predict(get_Name(False, True), learner)
-    title = f'CoTan数据处理 学习器:{learner}'
-    Creat_TextSheet(Data, title)
-    Update_BOX()
+def predict_learner():
+    learner = get_learner()
+    data = learner_controller.predict(get_name(False, True), learner)
+    title = f"CoTan数据处理 学习器:{learner}"
+    creat_text_sheet(data, title)
+    update_sheet_box()
 
 
-def Fit_Learner():
-    learner = get_Learner()
+def fit_learner():
+    learner = get_learner()
     try:
-        split = float(Split_Input.get())
+        split = float(data_split.get())
         if split < 0 or 1 < split:
             raise Exception
     except BaseException:
         split = 0.3
-    socore = ML.Fit(
-        get_Name(
-            False,
-            True),
-        get_Name(
-            False,
-            False),
+    socore = learner_controller.fit_model(
+        get_name(False, True),
+        get_name(False, False),
         learner,
-        Text=get_Args_Learner(),
-        split=split)
+        Text=get_learner_parameters(),
+        split=split,
+    )
     tkinter.messagebox.showinfo(
-        '训练完成', f'针对训练数据({(1 - split) * 100}%)评分结果为:{socore[0]}\n'
-        f'针对测试数据评分({split * 100}%)结果为:{socore[1]}')
+        "训练完成",
+        f"针对训练数据({(1 - split) * 100}%)评分结果为:{socore[0]}\n"
+        f"针对测试数据评分({split * 100}%)结果为:{socore[1]}",
+    )
 
 
-def set_Feature():
-    global X_OUT
-    X_OUT.set(get_Name())
+def set_x_data():
+    global x_data
+    x_data.set(get_name())
 
 
-def set_Label():
-    global Y_OUT
-    Y_OUT.set(get_Name())
+def set_y_data():
+    global y_data
+    y_data.set(get_name())
 
 
-def set_Learner():
-    global ML_OUT
-    ML_OUT.set(get_Learner(True))
+def set_learner():
+    global learner_output
+    learner_output.set(get_learner(True))
 
 
-def get_Learner(Type=False):
-    global Learn_Dic, ML_BOX, ML_OUT
-    if Type:
+def get_learner(return_box=False):
+    global learn_dict, learner_box, learner_output
+    if return_box:
         try:
-            return list(Learn_Dic.keys())[ML_BOX.curselection()[0]]
+            return list(learn_dict.keys())[learner_box.curselection()[0]]
         except BaseException:
             try:
-                return list(Learn_Dic.keys)[0]
+                return list(learn_dict.keys)[0]
             except BaseException:
-                return get_Learner(False)
+                return get_learner(False)
     else:
         try:
-            return ML_OUT.get()
+            return learner_output.get()
         except BaseException:
             return None
 
 
-def Add_Des():  # 添加Lenear的核心
-    Add_leaner('Statistics')
+def add_statistics():  # 添加Lenear的核心
+    add_leaner("Statistics")
 
 
-def Add_corr():
-    Add_leaner('Correlation')
+def add_correlation():
+    add_leaner("Correlation")
 
 
-def Add_MatrixScatter():
-    Add_leaner('MatrixScatter')
+def add_matrix_scatter():
+    add_leaner("MatrixScatter")
 
 
-def Add_View_data():
-    ML.Add_View_data(get_Learner(), Text=get_Args_Learner())
-    Update_Leaner()
+def add_view_data():
+    learner_controller.add_view_data(get_learner(), parameters=get_learner_parameters())
+    update_leaner()
 
 
-def Add_ClusterTree():
-    Add_leaner('ClusterTree')
+def add_cluster_tree():
+    add_leaner("ClusterTree")
 
 
-def Add_FeatureY_X():
-    Add_leaner('FeatureY-X')
+def add_feature_y_x():
+    add_leaner("FeatureY-X")
 
 
-def Add_Numpy_To_HeatMap():
-    Add_leaner('HeatMap')
+def add_numpy_to_heatmap():
+    add_leaner("HeatMap")
 
 
-def Add_Predictive_HeatMap_More():  # 添加Lenear的核心
-    ML.Add_Predictive_HeatMap_More(get_Learner(), Text=get_Args_Learner())
-    Update_Leaner()
+def add_predictive_heatmap_more():  # 添加Lenear的核心
+    learner_controller.add_predictive_heat_map_more(
+        get_learner(), parameters=get_learner_parameters()
+    )
+    update_leaner()
 
 
-def Add_Predictive_HeatMap():  # 添加Lenear的核心
-    ML.Add_Predictive_HeatMap(get_Learner(), Text=get_Args_Learner())
-    Update_Leaner()
+def add_predictive_heatmap():  # 添加Lenear的核心
+    learner_controller.add_predictive_heat_map(
+        get_learner(), parameters=get_learner_parameters()
+    )
+    update_leaner()
 
 
-def Add_FeatureScatterClass_all():
-    Add_leaner('FeatureScatterClass_all')
+def add_feature_scatter_class_all():
+    add_leaner("FeatureScatterClass_all")
 
 
-def Add_FeatureScatter_all():
-    Add_leaner('FeatureScatter_all')
+def add_feature_scatter_all():
+    add_leaner("FeatureScatter_all")
 
 
-def Add_FeatureScatterClass():
-    Add_leaner('FeatureScatterClass')
+def add_feature_scatter_class():
+    add_leaner("FeatureScatterClass")
 
 
-def Add_FeatureScatter():
-    Add_leaner('FeatureScatter')
+def add_feature_scatter():
+    add_leaner("FeatureScatter")
 
 
-def Add_ClassBar():
-    Add_leaner('ClassBar')
+def add_class_bar():
+    add_leaner("ClassBar")
 
 
-def Add_DBSCAN():
-    Add_leaner('DBSCAN')
+def add_dbscan():
+    add_leaner("DBSCAN")
 
 
-def Add_Agglomerative():
-    Add_leaner('Agglomerative')
+def add_agglomerative():
+    add_leaner("Agglomerative")
 
 
-def Add_KMeans():
-    Add_leaner('k-means')
+def add_k_means():
+    add_leaner("k-means")
 
 
-def Add_MLP_class():
-    Add_leaner('MLP_class')
+def add_mlp_class():
+    add_leaner("MLP_class")
 
 
-def Add_MLP():
-    Add_leaner('MLP')
+def add_mlp():
+    add_leaner("MLP")
 
 
-def Add_SVR():
-    Add_leaner('SVR')
+def add_svr():
+    add_leaner("SVR")
 
 
-def Add_SVC():
-    Add_leaner('SVC')
+def add_svc():
+    add_leaner("SVC")
 
 
-def Add_GradientTree():
-    Add_leaner('GradientTree')
+def add_gradient_tree():
+    add_leaner("GradientTree")
 
 
-def Add_GradientTree_class():
-    Add_leaner('GradientTree_class')
+def add_gradient_tree_class():
+    add_leaner("GradientTree_class")
 
 
-def Add_TSNE():
-    Add_leaner('t-SNE')
+def add_tsne():
+    add_leaner("t-SNE")
 
 
-def Add_NMF():
-    Add_leaner('NMF')
+def add_nmf():
+    add_leaner("NMF")
 
 
-def Add_LDA():
-    Add_leaner('LDA')
+def add_lda():
+    add_leaner("LDA")
 
 
-def Add_KPCA():
-    Add_leaner('KPCA')
+def add_kpca():
+    add_leaner("KPCA")
 
 
-def Add_RPCA():
-    Add_leaner('RPCA')
+def add_rpca():
+    add_leaner("RPCA")
 
 
-def Add_PCA():
-    Add_leaner('PCA')
+def add_pca():
+    add_leaner("PCA")
 
 
-def Add_Missed():
-    Add_leaner('Missed')
+def add_missed():
+    add_leaner("Missed")
 
 
-def Add_Label():
-    Add_leaner('Label')
+def add_label():
+    add_leaner("Label")
 
 
-def Add_OneHotEncoder():
-    Add_leaner('OneHotEncoder')
+def add_one_hot_encoder():
+    add_leaner("OneHotEncoder")
 
 
-def Add_Discretization():
-    Add_leaner('Discretization')
+def add_discretization():
+    add_leaner("Discretization")
 
 
-def Add_Binarizer():
-    Add_leaner('Binarizer')
+def add_binarizer():
+    add_leaner("Binarizer")
 
 
-def Add_Regularization():
-    Add_leaner('Regularization')
+def add_regularization():
+    add_leaner("Regularization")
 
 
-def Add_Fuzzy_quantization():
-    Add_leaner('Fuzzy_quantization')
+def add_fuzzy_quantization():
+    add_leaner("Fuzzy_quantization")
 
 
-def Add_Mapzoom():
-    Add_leaner('Mapzoom')
+def add_mapzoom():
+    add_leaner("Mapzoom")
 
 
-def Add_sigmodScaler():
-    Add_leaner('sigmodScaler')
+def add_sigmod_scaler():
+    add_leaner("sigmodScaler")
 
 
-def Add_decimalScaler():
-    Add_leaner('decimalScaler')
+def add_decimal_scaler():
+    add_leaner("decimalScaler")
 
 
-def Add_atanScaler():
-    Add_leaner('atanScaler')
+def add_atan_scaler():
+    add_leaner("atanScaler")
 
 
-def Add_LogScaler():
-    Add_leaner('LogScaler')
+def add_log_scaler():
+    add_leaner("LogScaler")
 
 
-def Add_MinMaxScaler():
-    Add_leaner('MinMaxScaler')
+def add_min_max_scaler():
+    add_leaner("MinMaxScaler")
 
 
-def Add_Z_Score():
-    Add_leaner('Z-Score')
+def add_z_score():
+    add_leaner("Z-Score")
 
 
-def Add_Forest():
-    Add_leaner('Forest')
+def add_forest():
+    add_leaner("Forest")
 
 
-def Add_Forest_class():
-    Add_leaner('Forest_class')
+def add_forest_class():
+    add_leaner("Forest_class")
 
 
-def Add_Tree_Class():
-    Add_leaner('Tree_class')
+def add_tree_class():
+    add_leaner("Tree_class")
 
 
-def Add_Tree():
-    Add_leaner('Tree')
+def add_tree():
+    add_leaner("Tree")
 
 
-def Add_SelectKBest():
-    Add_leaner('SelectKBest')
+def add_select_k_best():
+    add_leaner("SelectKBest")
 
 
-def Add_Knn_Class():
-    Add_leaner('Knn_class')
+def add_knn_class():
+    add_leaner("Knn_class")
 
 
-def Add_LogisticRegression():
-    Add_leaner('LogisticRegression')
+def add_logistic_regression():
+    add_leaner("LogisticRegression")
 
 
-def Add_Lasso():
-    Add_leaner('Lasso')
+def add_lasso():
+    add_leaner("Lasso")
 
 
-def Add_Variance():
-    Add_leaner('Variance')
+def add_variance():
+    add_leaner("Variance")
 
 
-def Add_Knn():
-    Add_leaner('Knn')
+def add_knn():
+    add_leaner("Knn")
 
 
-def Add_Ridge():
-    Add_leaner('Ridge')
+def add_ridge():
+    add_leaner("Ridge")
 
 
-def Add_Line():
-    Add_leaner('Line')
+def add_line():
+    add_leaner("Line")
 
 
-def Add_SelectFrom_Model():  # 添加Lenear的核心
-    ML.Add_SelectFrom_Model(get_Learner(), Text=get_Args_Learner())
-    Update_Leaner()
+def add_select_from_model():  # 添加Lenear的核心
+    learner_controller.add_select_from_model(
+        get_learner(), parameters=get_learner_parameters()
+    )
+    update_leaner()
 
 
-def Add_leaner(Type):  # 添加Lenear的核心
-    ML.Add_Learner(Type, Text=get_Args_Learner())
-    Update_Leaner()
+def add_leaner(learner_type):  # 添加Lenear的核心
+    learner_controller.add_learner(learner_type, parameters=get_learner_parameters())
+    update_leaner()
 
 
-def Update_Leaner():
-    global Learn_Dic, ML_BOX
-    Learn_Dic = ML.Return_Learner()
-    ML_BOX.delete(0, tkinter.END)
-    ML_BOX.insert(tkinter.END, *Learn_Dic.keys())
+def update_leaner():
+    global learn_dict, learner_box
+    learn_dict = learner_controller.return_learner()
+    learner_box.delete(0, tkinter.END)
+    learner_box.insert(tkinter.END, *learn_dict.keys())
 
 
-def Show_One():
-    global PATH, to_HTML_Type
-    Dic = f'{PATH}/$Show_Sheet.html'
+def to_html_one():
+    global PATH, to_html_type
+    html_dir = f"{PATH}/$Show_Sheet.html"
     try:
-        name = get_Name()
+        name = get_name()
         if name is None:
             raise Exception
-        ML.to_Html_One(name, Dic)
-        webbrowser.open(Dic)
+        learner_controller.to_html_one(name, html_dir)
+        webbrowser.open(html_dir)
     except BaseException:
         # pass
         raise
 
 
-def Show():
-    global PATH, to_HTML_Type
-    Dic = f'{PATH}/$Show_Sheet.html'
+def to_html():
+    global PATH, to_html_type
+    html_dir = f"{PATH}/$Show_Sheet.html"
     try:
-        name = get_Name()
+        name = get_name()
         if name is None:
             raise Exception
-        ML.to_Html(name, Dic, to_HTML_Type.get())
-        webbrowser.open(Dic)
+        learner_controller.to_html(name, html_dir, to_html_type.get())
+        webbrowser.open(html_dir)
     except BaseException:
         pass
 
 
-def to_CSV():
-    global top, Seq_Input, Code_Input, str_must, Index_must
-    Dic = asksaveasfilename(title='选择保存的CSV', filetypes=[("CSV", ".csv")])
-    Seq = Seq_Input.get()
-    name = get_Name()
-    ML.to_CSV(Dic, name, Seq)
-    Update_BOX()
+def to_csv():
+    global SCREEN, sep, encoding, dtype_str, Index_must
+    save_dir = asksaveasfilename(title="选择保存的CSV", filetypes=[("CSV", ".csv")])
+    csv_sep = sep.get()
+    name = get_name()
+    learner_controller.to_csv(save_dir, name, csv_sep)
+    update_sheet_box()
 
 
-def Add_CSV():
-    global top, Seq_Input, Code_Input, str_must, name_Input
-    Dic = askopenfilename(title='选择载入的CSV', filetypes=[("CSV", ".csv")])
-    if Dic == '':
+def add_csv():
+    global SCREEN, sep, encoding, dtype_str, sheet_name
+    csv_dir = askopenfilename(title="选择载入的CSV", filetypes=[("CSV", ".csv")])
+    if csv_dir == "":
         return False
-    Seq = Seq_Input.get()
-    Codeing = Code_Input.get()
-    str_ = bool(str_must.get())
-    name = name_Input.get().replace(' ', '')
-    if name == '':
-        name = os.path.splitext(os.path.split(Dic)[1])[0]
-        print(name)
-    if Codeing == '':
-        with open(Dic, 'rb') as f:
-            Codeing = chardet.detect(f.read())['encoding']
-    if Seq == '':
-        Seq = ','
-    ML.read_csv(Dic, name, Codeing, str_, Seq,)
-    Update_BOX()
-
-
-def Add_Python():
-    global top, Seq_Input, Code_Input, str_must, Index_must
-    Dic = askopenfilename(
-        title='选择载入的py', filetypes=[
-            ("Python", ".py"), ("Txt", ".txt")])
-    name = name_Input.get().replace(' ', '')
-    if name == '':
-        name = os.path.splitext(os.path.split(Dic)[1])[0]
-    with open(Dic, 'r') as f:
-        ML.Add_Python(f.read(), name)
-    Update_BOX()
-
-
-def get_Name(Type=True, x=True):  # 获得名字统一接口
-    global Form_List, Form_BOX, X_OUT
-    if Type:
+    sep = sep.get()
+    encoding = encoding.get()
+    must_str = bool(dtype_str.get())
+    name = sheet_name.get().replace(" ", "")
+    if name == "":
+        name = os.path.splitext(os.path.split(csv_dir)[1])[0]
+    if encoding == "":
+        with open(csv_dir, "rb") as f:
+            encoding = chardet.detect(f.read())["encoding"]
+    if sep == "":
+        sep = ","
+    learner_controller.read_csv(
+        csv_dir, name, encoding, must_str, sep,
+    )
+    update_sheet_box()
+
+
+def add_python():
+    global SCREEN, sep, encoding, dtype_str, Index_must
+    python_dir = askopenfilename(
+        title="选择载入的py", filetypes=[("Python", ".py"), ("Txt", ".txt")]
+    )
+    name = sheet_name.get().replace(" ", "")
+    if name == "":
+        name = os.path.splitext(os.path.split(python_dir)[1])[0]
+    with open(python_dir, "r") as f:
+        learner_controller.add_python(f.read(), name)
+    update_sheet_box()
+
+
+def get_name(get_from_box=True, is_x_data=True):  # 获得名字统一接口
+    global sheet_list, sheet_box, x_data
+    if get_from_box:
         try:
-            return Form_List[Form_BOX.curselection()[0]]
+            return sheet_list[sheet_box.curselection()[0]]
         except BaseException:
             try:
-                return Form_List[0]
+                return sheet_list[0]
             except BaseException:
                 return None
     else:
         try:
-            if x:
-                return X_OUT.get()
+            if is_x_data:
+                return x_data.get()
             else:
-                return Y_OUT.get()
+                return y_data.get()
         except BaseException:
             return None
 
 
-def Update_BOX():
-    global top, Form_BOX, Form_List
-    Form_List = list(ML.get_Form().keys())
-    Form_BOX.delete(0, tkinter.END)
-    Form_BOX.insert(tkinter.END, *Form_List)
+def update_sheet_box():
+    global SCREEN, sheet_box, sheet_list
+    sheet_list = list(learner_controller.get_form().keys())
+    sheet_box.delete(0, tkinter.END)
+    sheet_box.insert(tkinter.END, *sheet_list)
 
 
-def Creat_TextSheet(data, name):
-    global bg
-    new_top = tkinter.Toplevel(bg=bg)
+def creat_text_sheet(data, name):
+    global bg_color
+    new_top = tkinter.Toplevel(bg=bg_color)
     new_top.title(name)
-    new_top.geometry('+10+10')  # 设置所在位置
-    text = ScrolledText(new_top, font=('黑体', 13), height=50)
+    new_top.geometry("+10+10")  # 设置所在位置
+    text = ScrolledText(new_top, font=("黑体", 13), height=50)
     text.pack(fill=tkinter.BOTH)
-    text.insert('0.0', data)
+    text.insert("0.0", data)
     text.config(state=tkinter.DISABLED)
     new_top.resizable(width=False, height=False)

+ 1 - 1
Machine_learning_analysis/__init__.py

@@ -1,2 +1,2 @@
-from Machine_learning_analysis.Machine_learning import Main
+from Machine_learning_analysis.Machine_learning import machine_learning
 print('机器学习分析加载完毕...')

+ 10 - 8
New_TK/__init__.py

@@ -1,5 +1,6 @@
 import tkinter as tk
 
+
 class DragWindow(tk.Tk):
     root_x, root_y, abs_x, abs_y = 0, 0, 0, 0
     width, height = None, None
@@ -7,12 +8,9 @@ class DragWindow(tk.Tk):
     def __init__(self, alpha=0.97, width=None, height=None):
         super().__init__()
         self.width, self.height = width, height
-        # self.overrideredirect(True)
-        self.wm_attributes("-alpha", alpha)      # 透明度
-        # self.wm_attributes("-toolwindow", True)  # 置为工具窗口
-        # self.wm_attributes("-topmost", topmost)  # 永远处于顶层
-        self.bind('<B1-Motion>', self._on_move)
-        self.bind('<ButtonPress-1>', self._on_tap)
+        self.wm_attributes("-alpha", alpha)  # 透明度
+        self.bind("<B1-Motion>", self._on_move)
+        self.bind("<ButtonPress-1>", self._on_tap)
 
     def set_display_postion(self, offset_x, offset_y):
         self.geometry("+%s+%s" % (offset_x, offset_y))
@@ -26,8 +24,12 @@ class DragWindow(tk.Tk):
         offset_y = event.y_root - self.root_y
 
         if self.width and self.height:
-            geo_str = "%sx%s+%s+%s" % (self.width, self.height,
-                                       self.abs_x + offset_x, self.abs_y + offset_y)
+            geo_str = "%sx%s+%s+%s" % (
+                self.width,
+                self.height,
+                self.abs_x + offset_x,
+                self.abs_y + offset_y,
+            )
         else:
             geo_str = "+%s+%s" % (self.abs_x + offset_x, self.abs_y + offset_y)
         self.geometry(geo_str)

Alguns ficheiros não foram mostrados porque muitos ficheiros mudaram neste diff