from PyQt5.QtWidgets import QWidget, QApplication, QMainWindow, QLabel, QPushButton from PyQt5 import QtCore, QtGui import sys import os def click(): print("Hy Button is clicked!") # Press the green button in the gutter to run the script. if __name__ == '__main__': print_hi('PyCharm,Geovin Du,涂聚文') #StudentId = 1, StudentName = 'geovindu', StudentNO = '0001', StudentBirthday = datetime.datetime(2007, 12, 5) #创建表 #stu=Mapping.StudentMaping.Student() #stu.CreateTable() '''''' app = QApplication(sys.argv) widget = QWidget() widget.resize(640, 480) widget.setWindowTitle("Hello, PyQt5!") # Label Text label = QLabel(widget) label.resize(300, 100) label.setText("Hi this is Pyqt5,涂聚文学习中") label.move(100, 100) button = QPushButton(widget) button.resize(200, 100) button.setText("Hi! Click Me") button.move(400, 300) button.clicked.connect(click) widget.show() sys.exit(app.exec())
输出:
标签:__,widget,beginner,python,button,PyQt5,label,100 From: https://www.cnblogs.com/geovindu/p/17535937.html