python: PyQt5 beginner

 

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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())

  输出:

 

posted @   ®Geovin Du Dream Park™  阅读(8)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 25岁的心里话
· 闲置电脑爆改个人服务器(超详细) #公网映射 #Vmware虚拟网络编辑器
· 基于 Docker 搭建 FRP 内网穿透开源项目(很简单哒)
· 零经验选手,Compose 一天开发一款小游戏!
· 一起来玩mcp_server_sqlite,让AI帮你做增删改查!!
历史上的今天:
2022-07-07 sql server:Pivot and UNPivot data with date in the columns
2015-07-07 csharp: DataTable Rename ColumnName and remove Column
2009-07-07 gb2312简繁转换js兼容各种浏览器
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示