You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
727 B
25 lines
727 B
import sys |
|
from PyQt5.QtWidgets import QApplication, QWidget, QPushButton, QMessageBox |
|
|
|
class MyWindow(QWidget): |
|
def __init__(self): |
|
super().__init__() |
|
|
|
self.setWindowTitle("PyQt5 简单示例") |
|
self.setGeometry(100, 100, 300, 200) |
|
|
|
self.button = QPushButton("点我一下", self) |
|
self.button.setGeometry(100, 80, 100, 30) |
|
self.button.clicked.connect(self.show_message) |
|
|
|
def show_message(self): |
|
QMessageBox.information(self, "提示", "按钮被点击了!") |
|
|
|
if __name__ == "__main__": |
|
app = QApplication(sys.argv) |
|
window = MyWindow() |
|
window.show() |
|
sys.exit(app.exec_()) |
|
""" |
|
pyinstaller qt5_demo.py --hidden-import PySide2.QtXml |
|
"""
|
|
|