import os import re import sys from PyQt5 import QtWidgets, QtCore from PyQt5.QtWidgets import QWidget, QApplication from untitled import Ui_Form # 界面 class Main(QWidget, Ui_Form): def __init__(self): super(Main, self).__init__() self.setupUi(self) self.start.clicked.connect(lambda: self.print()) def print(self): print("开始") def main(): app = QApplication(sys.argv) # app.setStyleSheet(open("Network.qss", encoding='utf8').read()) # qss文件引入 ui = Main() ui.show() sys.exit(app.exec_()) if __name__ == "__main__": main()