From bc6aba924a54df0826621cb6346f341b651dde2a Mon Sep 17 00:00:00 2001 From: "weiye.wang" Date: Wed, 24 Apr 2024 23:45:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=BF=87=E4=B8=B4=E6=97=B6=E6=96=87?= =?UTF-8?q?=E4=BB=B6/databasename.txt=E5=AE=9E=E7=8E=B0=E4=BC=A0=E9=80=92?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=BA=93=E5=90=8D,=20=E5=AF=BB=E6=89=BE?= =?UTF-8?q?=E7=A9=BA=E9=97=B2=E9=A2=98=E5=8F=B7=E5=9F=BA=E6=9C=AC=E5=AE=8C?= =?UTF-8?q?=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 工具v4/tool_panel.py | 6 +++++- 工具v4/寻找空闲题号.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/工具v4/tool_panel.py b/工具v4/tool_panel.py index 18797a26..2f0016be 100644 --- a/工具v4/tool_panel.py +++ b/工具v4/tool_panel.py @@ -1,5 +1,6 @@ from PySide6.QtWidgets import QWidget, QApplication, QFileDialog, QMainWindow from Ui_tool_panel import Ui_MainWindow +from PySide6.QtCore import Signal, Slot from 寻找空闲题号 import MyWindow_kxth from database_tools_2 import * @@ -8,6 +9,7 @@ class MyWindow(QMainWindow,Ui_MainWindow): super().__init__() self.setupUi(self) self.bind() + def bind(self): self.SelectTIKUTEST() self.pushButton_tiku.clicked.connect(self.SelectTIKU) @@ -19,10 +21,12 @@ class MyWindow(QMainWindow,Ui_MainWindow): def SelectTIKU(self): self.pushButton_tiku.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体 self.pushButton_tikutest.setStyleSheet("") #恢复原有背景, 取消粗体 - self.database = "tiku" + SaveTextFile("tiku","临时文件/databasename.txt") + self.database = "tiku" def SelectTIKUTEST(self): self.pushButton_tikutest.setStyleSheet("background-color: green; font-weight: bold;") #绿色背景粗体 self.pushButton_tiku.setStyleSheet("") #恢复原有背景, 取消粗体 + SaveTextFile("tikutest","临时文件/databasename.txt") self.database = "tikutest" diff --git a/工具v4/寻找空闲题号.py b/工具v4/寻找空闲题号.py index 6b9d272b..f78e2965 100644 --- a/工具v4/寻找空闲题号.py +++ b/工具v4/寻找空闲题号.py @@ -6,7 +6,6 @@ from database_tools_2 import * class MyWindow_kxth(QWidget,Ui_Form): def __init__(self,database_name): super().__init__() - self.databaes_name = database_name self.setupUi(self) self.bind() def bind(self): @@ -16,6 +15,7 @@ class MyWindow_kxth(QWidget,Ui_Form): def exec(self): + self.databaes_name = ReadTextFile("临时文件/databasename.txt").strip() self.label_used.setText(usedIDs(self.databaes_name)) self.label_available.setText(spareIDs(self.databaes_name)) print(self.databaes_name)