-
Notifications
You must be signed in to change notification settings - Fork 0
/
Truth_table_of_logical_expressions_v2.0.py
49 lines (41 loc) · 1.8 KB
/
Truth_table_of_logical_expressions_v2.0.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
from tkinter import ttk
from draw import *
from simplification import *
if __name__ == '__main__':
root = tk.Tk()
root.geometry('500x250')
root.title('逻辑函数计算器')
root.resizable(False, False)
notebook = ttk.Notebook(root)
notebook.pack(pady=5, expand=True)
frame1 = ttk.Frame(notebook, width=490, height=290)
frame2 = ttk.Frame(notebook, width=490, height=290)
frame3 = ttk.Frame(notebook, width=490, height=290)
frame1.pack(fill='both', expand=True)
frame2.pack(fill='both', expand=True)
frame3.pack(fill='both', expand=True)
notebook.add(frame1, text='单返回逻辑函数画图')
notebook.add(frame2, text='多返回逻辑函数画图')
notebook.add(frame3, text='函数化简')
# 单返回逻辑函数
label = tk.Label(frame1, text="请输入逻辑函数:")
label.place(x=60, y=40)
entry = tk.Entry(frame1, width=30)
entry.place(x=170, y=40)
start_button = tk.Button(frame1, text="开始", command=lambda: start_button_clicked(entry))
start_button.place(x=240, y=90)
# 多返回逻辑函数计算
label1 = tk.Label(frame2, text="请输入表达式的个数:")
label1.place(x=120, y=40)
entry1 = tk.Entry(frame2, width=10)
entry1.place(x=250, y=40)
start_button1 = tk.Button(frame2, text="开始", command=lambda: Multi_function_input_interface(entry1.get()))
start_button1.place(x=240, y=90)
# 函数化简
label2 = tk.Label(frame3, text="请输入要化简的表达式:")
label2.place(x=50, y=40)
entry2 = tk.Entry(frame3, width=30)
entry2.place(x=190, y=40)
start_button2 = tk.Button(frame3, text="开始", command=lambda: Functional_simplification(entry2.get()))
start_button2.place(x=240, y=90)
root.mainloop()