from PySide6.QtWidgets import QMainWindow, QApplication, QFileDialog, QWidget from Ui_Qt面板 import * from subprocess import call class MyWindow(QMainWindow,Ui_MainWindow): def __init__(self): super().__init__() self.setupUi(self) self.bind() def bind(self): self.action_kxth.triggered.connect(lambda: call(["python", "系列讲义生成.py"])) self.action_xtbd.triggered.connect(lambda: call(["python", "新题比对.py"])) if __name__ == '__main__': app = QApplication([]) windows = MyWindow() windows.show() app.exec()