From 21ffb281954a4becfdc678984c5a5a6851180f31 Mon Sep 17 00:00:00 2001 From: wangweiye7840 Date: Tue, 12 Mar 2024 18:12:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8D=95=E4=B8=80=E9=A2=98=E5=8F=B7=E8=BD=AC?= =?UTF-8?q?=E4=B8=BA=E5=9B=BE=E7=89=87=E5=8A=9F=E8=83=BD=E7=8E=B0=E5=8F=AF?= =?UTF-8?q?=E8=87=AA=E7=94=B1=E8=BE=93=E5=85=A5=E5=89=8D=E7=BC=80=E4=BF=A1?= =?UTF-8?q?=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v2/Ui_单一题号转为图片.py | 10 +++++++++- 工具v2/单一题号转为图片.py | 3 ++- 工具v2/单一题号转为图片.ui | 28 +++++++++++++++++++++++++++- 3 files changed, 38 insertions(+), 3 deletions(-) diff --git a/工具v2/Ui_单一题号转为图片.py b/工具v2/Ui_单一题号转为图片.py index 94386064..63297f4f 100644 --- a/工具v2/Ui_单一题号转为图片.py +++ b/工具v2/Ui_单一题号转为图片.py @@ -22,7 +22,7 @@ class Ui_Form(object): def setupUi(self, Form): if not Form.objectName(): Form.setObjectName(u"Form") - Form.resize(278, 69) + Form.resize(278, 97) self.label = QLabel(Form) self.label.setObjectName(u"label") self.label.setGeometry(QRect(10, 10, 31, 16)) @@ -41,6 +41,12 @@ class Ui_Form(object): self.pushButton_open = QPushButton(Form) self.pushButton_open.setObjectName(u"pushButton_open") self.pushButton_open.setGeometry(QRect(200, 10, 75, 51)) + self.label_3 = QLabel(Form) + self.label_3.setObjectName(u"label_3") + self.label_3.setGeometry(QRect(10, 70, 51, 16)) + self.lineEdit_message = QLineEdit(Form) + self.lineEdit_message.setObjectName(u"lineEdit_message") + self.lineEdit_message.setGeometry(QRect(70, 70, 201, 20)) self.retranslateUi(Form) @@ -53,5 +59,7 @@ class Ui_Form(object): self.label_2.setText(QCoreApplication.translate("Form", u"DPI", None)) self.pushButton_convert.setText(QCoreApplication.translate("Form", u"\u8f6c\u6362", None)) self.pushButton_open.setText(QCoreApplication.translate("Form", u"\u6253\u5f00", None)) + self.label_3.setText(QCoreApplication.translate("Form", u"\u9644\u52a0\u6587\u5b57", None)) + self.lineEdit_message.setPlaceholderText(QCoreApplication.translate("Form", u"\u8f93\u5165\u9644\u52a0\u6587\u5b57, \u7559\u7a7a\u8868\u793a\u65e0\u9644\u52a0\u6587\u5b57", None)) # retranslateUi diff --git a/工具v2/单一题号转为图片.py b/工具v2/单一题号转为图片.py index 0b213006..3462f472 100644 --- a/工具v2/单一题号转为图片.py +++ b/工具v2/单一题号转为图片.py @@ -21,7 +21,8 @@ class MyWindow(QWidget,Ui_Form): self.id = self.lineEdit_ID.text() self.dpi = self.lineEdit_dpi.text() pro_dict = load_dict("../题库0.3/Problems.json") - content = pro_dict[self.id.zfill(6)]["content"] + prefix = self.lineEdit_message.text().strip() + content = f"{prefix} {pro_dict[self.id.zfill(6)]['content']}" latex_raw = ReadTextFile("模板文件/独立文件模板.txt") latexdata = StringSubstitute(r"<<待替换\d*>>",latex_raw,[content]) makedir("临时文件/pics") diff --git a/工具v2/单一题号转为图片.ui b/工具v2/单一题号转为图片.ui index 789419b1..fbc411ec 100644 --- a/工具v2/单一题号转为图片.ui +++ b/工具v2/单一题号转为图片.ui @@ -7,7 +7,7 @@ 0 0 278 - 69 + 97 @@ -85,6 +85,32 @@ 打开 + + + + 10 + 70 + 51 + 16 + + + + 附加文字 + + + + + + 70 + 70 + 201 + 20 + + + + 输入附加文字, 留空表示无附加文字 + +