个人技术分享

在这里插入图片描述
在这里插入图片描述

import sys

from PyQt6 import QtCore, QtGui, QtWidgets, uic
from PyQt6.QtWidgets import QApplication,QWidget


class Ui_Form(object):
    def setupUi(self, Form):
        Form.setObjectName("Form")
        Form.resize(400, 300)
        self.pushButton = QtWidgets.QPushButton(parent=Form)
        self.pushButton.setGeometry(QtCore.QRect(130, 40, 75, 24))
        self.pushButton.setObjectName("pushButton")

        self.retranslateUi(Form)
        QtCore.QMetaObject.connectSlotsByName(Form)

    def retranslateUi(self, Form):
        _translate = QtCore.QCoreApplication.translate
        Form.setWindowTitle(_translate("Form", "Form"))
        self.pushButton.setText(_translate("Form", "PushButton"))

"""
下面代码要自己添加,上面是自动生成的
"""
if __name__ == '__main__':
    app = QApplication(sys.argv)
    w=QWidget()
    Ui_Form().setupUi(w)
    w.show()
    sys.exit(app.exec())