from PySide6.QtWidgets import QWidget, QApplication, QFileDialog from Ui_基础知识编辑 import Ui_Form from database_tools_2 import * class MyWindow_bjjc(QWidget,Ui_Form): def __init__(self,database_name): super().__init__() self.database_name = database_name self.setupUi(self) self.bind() def setdbname(self,string): self.database_name = string try: self.db.close() except: pass self.db = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) self.cursor = self.db.cursor() # print(self.database_name) def bind(self): self.pushButton_getcontent.clicked.connect(self.getcontent) self.pushButton_modify.clicked.connect(self.modify) self.pushButton_commit.clicked.connect(self.tocommit) self.pushButton_commit.setDisabled(True) self.db = connect(hostname = db_host, port = db_port, username=db_user, pwd=db_pwd, db = self.database_name) self.cursor = self.db.cursor() errorflag = True def getcontent(self): pass def modify(self): pass def tocommit(self): self.pushButton_commit.setDisabled(True) pass if __name__ == '__main__': app = QApplication([]) windows = MyWindow_bjtm() windows.show() app.exec()