From 491e35fb57529aab8d1770f896d0fb37dd0adfd2 Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Sat, 27 Apr 2024 20:36:19 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=9F=A5=E8=AF=86=E6=A2=B3=E7=90=86=20?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E4=B8=80=E4=B8=AAbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v4/新增基础知识梳理.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/工具v4/新增基础知识梳理.py b/工具v4/新增基础知识梳理.py index 2e82f214..40e36105 100644 --- a/工具v4/新增基础知识梳理.py +++ b/工具v4/新增基础知识梳理.py @@ -20,13 +20,14 @@ class MyWindow_tjjc(QWidget,Ui_Form): self.pushButton_exec.clicked.connect(self.execstep1) self.pushButton_commit.clicked.connect(self.commitstep) self.pushButton_commit.setDisabled(True) - self.mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) + def selectfilepath(self): self.filepath = QFileDialog.getOpenFileName(self,"选择.tex文件",os.getcwd(),"tex文件(*.tex);;所有文件(*)")[0] self.lineEdit_filepath.setText(self.filepath) self.pushButton_exec.setEnabled(True) def execstep1(self): + self.mydb = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) mycursor = self.mydb.cursor() mycursor.execute("SELECT bn_id FROM basic_knowledges;") bnids = [ret[0] for ret in mycursor.fetchall()]