关键字筛选题号功能在每次编译后会留下日期时间和题号列表

This commit is contained in:
weiye.wang 2024-03-03 14:58:46 +08:00
parent 77068d9df8
commit 85ce9ae92c
1 changed files with 8 additions and 1 deletions

View File

@ -1,6 +1,7 @@
from PySide6.QtWidgets import QWidget, QApplication, QLineEdit
from Ui_题号筛选器 import Ui_Form
from database_tools import *
import time,os
class MyWindow(QWidget,Ui_Form):
def __init__(self):
@ -56,7 +57,10 @@ class MyWindow(QWidget,Ui_Form):
def build(self):
exp = generate_exp(self.matchlist)
SaveTextFile(exp,"临时文件/题号筛选.txt")
try:
AppendTextFile(f"\n{time.ctime()}\n{exp}\n","临时文件/题号筛选.txt")
except:
SaveTextFile(f"{time.ctime()}\n{exp}\n","临时文件/题号筛选.txt")
prodictpath = "../题库0.3/problems.json"
objdictpath = "../题库0.3/lessonobj.json"
raw_pro_dict = load_dict(prodictpath)
@ -133,6 +137,9 @@ class MyWindow(QWidget,Ui_Form):
endtime = time.time()
print(f"生成pdf文件所花时间: {endtime-midtime:.3f}")
os.system("code 临时文件/题号筛选.txt")
os.startfile("临时文件")