20230329 night

This commit is contained in:
weiye.wang 2023-03-29 22:44:07 +08:00
parent 2650c34c04
commit ddcc42b904
1 changed files with 15 additions and 10 deletions

View File

@ -11,11 +11,16 @@ root.title('题库v2.0工具面板')
def temp(): def temp():
pass pass
def SetButton1(str): def SetButton(str,numbuttons,openfilelist):
commandname.set(str) commandname.set(str)
LabelTool.config(text = str) LabelTool.config(text = str)
button1.place(x = 600, y = 550) button1.place(x = 600, y = 550)
button2.place_forget() if numbuttons == 1:
button2.place_forget()
else:
button2.place(x=700, y=550)
for f in openfilelist:
os.system("code "+f)
def run_command1(): def run_command1():
@ -51,33 +56,33 @@ LabelTool.place(x=420,y=50)
button1 = Button(root, text = "运行STEP1", command = run_command1) button1 = Button(root, text = "运行STEP1", command = run_command1)
button2 = Button(root, text = "运行STEP2", command = run_command2) button2 = Button(root, text = "运行STEP2", command = run_command2)
button3 = Button(root, text = "运行STEP3") # button3 = Button(root, text = "运行STEP3")
menubar = Menu(root) menubar = Menu(root)
# 设置 录入 菜单项 # 设置 录入 菜单项
ImportMenu = Menu(menubar, tearoff = False) ImportMenu = Menu(menubar, tearoff = False)
menubar.add_cascade(label = "录入", menu = ImportMenu) menubar.add_cascade(label = "录入", menu = ImportMenu)
ImportMenu.add_command(label = "寻找空闲题号", command = lambda: (commandname.set("寻找空闲题号"),LabelTool.config(text = "寻找空闲题号"),button1.place(x = 600, y = 550),button2.place_forget())) ImportMenu.add_command(label = "寻找空闲题号", command = lambda: SetButton("寻找空闲题号",1,[]))
ImportMenu.add_separator() ImportMenu.add_separator()
ImportMenu.add_command(label = "批量收录题目", command = lambda: (commandname.set("批量收录题目"),LabelTool.config(text = "批量收录题目"),button1.place(x = 600, y = 550),button2.place_forget(),os.system("code 批量收录题目.py"))) ImportMenu.add_command(label = "批量收录题目", command = lambda: SetButton("批量收录题目",1,["批量收录题目.py"]))
ImportMenu.add_command(label = "添加关联题目", command = lambda: (commandname.set("添加关联题目"),LabelTool.config(text = "添加关联题目(两阶段)"),button1.place(x = 600, y = 550),button2.place(x = 700, y = 550),os.system("code 添加关联题目.py"))) ImportMenu.add_command(label = "添加关联题目", command = lambda: SetButton("添加关联题目",2,["添加关联题目.py"]))
# 设置 维护 菜单项 # 设置 维护 菜单项
MaintainenceMenu = Menu(menubar, tearoff = False) MaintainenceMenu = Menu(menubar, tearoff = False)
menubar.add_cascade(label = "维护", menu = MaintainenceMenu) menubar.add_cascade(label = "维护", menu = MaintainenceMenu)
MaintainenceMenu.add_command(label = "修改题目", command = lambda: (commandname.set("修改题目数据库"),LabelTool.config(text = "修改题目(两阶段)"),button1.place(x = 600, y = 550),button2.place(x = 700, y = 550),os.system("code 修改题目数据库.py"))) MaintainenceMenu.add_command(label = "修改题目", command = lambda: SetButton("修改题目数据库",2,["修改题目数据库.py"]))
# 设置 使用 菜单项 # 设置 使用 菜单项
UseMenu = Menu(menubar, tearoff = False) UseMenu = Menu(menubar, tearoff = False)
menubar.add_cascade(label = "使用", menu = UseMenu) menubar.add_cascade(label = "使用", menu = UseMenu)
UseMenu.add_command(label = "题号选题pdf生成", command = lambda: (commandname.set("题号选题pdf生成"),LabelTool.config(text = "题号选题pdf生成"),button1.place(x = 600, y = 550),button2.place_forget(),os.system("code 题号选题pdf生成.py"))) UseMenu.add_command(label = "题号选题pdf生成", command = lambda: SetButton("题号选题pdf生成",1,["题号选题pdf生成.py"]))
# 设置 其他 菜单项 # 设置 其他 菜单项
OtherMenu = Menu(menubar, tearoff = False) OtherMenu = Menu(menubar, tearoff = False)
menubar.add_cascade(label = "其他", menu = OtherMenu) menubar.add_cascade(label = "其他", menu = OtherMenu)
OtherMenu.add_command(label = "mathpix预处理", command = lambda: (commandname.set("mathpix预处理"),LabelTool.config(text = "mathpix预处理"),button1.place(x = 600, y = 550),button2.place_forget())) OtherMenu.add_command(label = "mathpix预处理", command = lambda: SetButton("mathpix预处理",1,[]))
OtherMenu.add_command(label = "带圈数字处理", command = lambda: (commandname.set("带圈数字处理"),LabelTool.config(text = "带圈数字处理"),button1.place(x = 600, y = 550),button2.place_forget())) OtherMenu.add_command(label = "带圈数字处理", command = lambda: SetButton("带圈数字处理",1,[]))
menubar.add_command(label = "退出", command = root.destroy) menubar.add_command(label = "退出", command = root.destroy)