1、通过窗口类的属性来传递参数
from PyQt5.QtWidgets import QDialogButtonBox, QDateTimeEdit, QDialog, QComboBox, QTableView, QAbstractItemView, \
QHeaderView, QTableWidget, QTableWidgetItem, QMessageBox, QListWidget, QListWidgetItem, QStatusBar, QMenuBar, QMenu, \
QAction, QLineEdit, QStyle, QFormLayout, QVBoxLayout, QWidget, QApplication, QHBoxLayout, QPushButton, QMainWindow, \
QGridLayout, QLabel
from PyQt5.QtGui import QIcon, QPixmap, QStandardItem, QStandardItemModel, QCursor, QFont, QBrush, QColor, QPainter, \
QMouseEvent, QImage, QTransform
from PyQt5.QtCore import QStringListModel, QAbstractListModel, QModelIndex, QSize, Qt, QObject, pyqtSignal, QTimer, \
QEvent, QDateTime, QDate
import sys
class Win(QWidget):
def __init__(self, parent=None):
super(Win, self).__init__(parent)
self.resize(400, 400)
self.btn = QPushButton("按钮", self)
self.btn.move(50, 50)
self.btn.setMinimumWidth(80)
self.label = QLabel('显示信息', self)
self.label.setMinimumWidth(420)
self.btn.clicked.connect(self.fn)
def fn(self)</