From bdda463b520acc5cfa62f6c616eda0b064493e17 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Thu, 25 Apr 2024 23:44:48 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=80=E5=A4=84=E8=BF=87?= =?UTF-8?q?=E6=97=A9=E8=BF=9E=E6=8E=A5=E6=95=B0=E6=8D=AE=E5=BA=93=E7=9A=84?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v4/关键字筛选题号.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/工具v4/关键字筛选题号.py b/工具v4/关键字筛选题号.py index a5cf7f61..9241b0e4 100644 --- a/工具v4/关键字筛选题号.py +++ b/工具v4/关键字筛选题号.py @@ -9,10 +9,6 @@ class MyWindow_sxth(QWidget,Ui_Form): self.database_name = database_name self.setupUi(self) self.conditions = [] - mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) - mycursor = mydb.cursor() - mycursor.execute("SELECT count(*) FROM problems WHERE NOT content REGEXP 'OBS';") - self.lcdNumber_resCount.display(mycursor.fetchall()[0][0]) self.bind() def setdbname(self,string): self.database_name = string @@ -52,6 +48,10 @@ class MyWindow_sxth(QWidget,Ui_Form): text += f"字段 {field} 中{'没有' if flag_not else '有 '}{' 或 '.join([t.strip() for t in matchexp.split(',')])}\n" self.label_conditions.setText(text) def exec(self): + mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) + mycursor = mydb.cursor() + mycursor.execute("SELECT count(*) FROM problems WHERE NOT content REGEXP 'OBS';") + self.lcdNumber_resCount.display(mycursor.fetchall()[0][0]) self.matchlist = MatchConditioninMariaDB(self.conditions,self.database_name) self.lcdNumber_resCount.display(len(self.matchlist))