pyqt 你好,世界
示例
此基本代码将使用PyQt4启动“Helloworld”GUI窗口:
import sys
from PyQt4 import QtGui
# create instance of QApplication
app = QtGui.QApplication(sys.argv)
# create QLabel, without parent it will be shown as window
label = QtGui.QLabel('Hello world!')
label.show()
# start the execution loop of the application
sys.exit(app.exec_())这是使用PyQt5的相同代码。
import sys
from PyQt5 import QtWidgets
# create instance of QApplication
app = QtWidgets.QApplication(sys.argv)
# create QLabel, without parent it will be shown as window
label = QtWidgets.QLabel('Hello world!')
label.show()
# start the execution loop of the application
sys.exit(app.exec_())
热门推荐
10 新年门口花束祝福语简短
11 盘锦结婚祝福语大全简短
12 父母生日祝福语 简短独特
13 家庭恩爱祝福语简短英文
14 高考俄语祝福语大全简短
15 虎年祝福语 诗句唯美简短
16 生日婚礼祝福语简短精辟
17 虎年喝酒拜年祝福语简短
18 教师闺蜜祝福语简短