玩蛇网提供最新Python编程技术信息以及Python资源下载!

下面的python 程序怎么输出窗口运行

from PyQt5 import QtCore, QtGui, QtWidgets

class Ui_MainWindow(object):

def setupUi(self, MainWindow):
    MainWindow.setObjectName("MainWindow")
    MainWindow.resize(472, 239)
    self.centralwidget = QtWidgets.QWidget(MainWindow)
    self.centralwidget.setObjectName("centralwidget")
    self.pushButton = QtWidgets.QPushButton(self.centralwidget)
    self.pushButton.setGeometry(QtCore.QRect(90, 130, 75, 23))
    self.pushButton.setObjectName("pushButton")
    self.timeEdit = QtWidgets.QTimeEdit(self.centralwidget)
    self.timeEdit.setGeometry(QtCore.QRect(170, 60, 131, 41))
    self.timeEdit.setObjectName("timeEdit")
    self.label = QtWidgets.QLabel(self.centralwidget)
    self.label.setGeometry(QtCore.QRect(240, 150, 191, 41))
    self.label.setObjectName("label")
    MainWindow.setCentralWidget(self.centralwidget)
    self.statusbar = QtWidgets.QStatusBar(MainWindow)
    self.statusbar.setObjectName("statusbar")
    MainWindow.setStatusBar(self.statusbar)
    self.menuBar = QtWidgets.QMenuBar(MainWindow)
    self.menuBar.setGeometry(QtCore.QRect(0, 0, 472, 23))
    self.menuBar.setObjectName("menuBar")
    self.menu = QtWidgets.QMenu(self.menuBar)
    self.menu.setObjectName("menu")
    MainWindow.setMenuBar(self.menuBar)
    self.action33 = QtWidgets.QAction(MainWindow)
    self.action33.setObjectName("action33")
    self.action_2 = QtWidgets.QAction(MainWindow)
    self.action_2.setObjectName("action_2")
    self.menu.addAction(self.action_2)
    self.menuBar.addAction(self.menu.menuAction())

    self.retranslateUi(MainWindow)
    QtCore.QMetaObject.connectSlotsByName(MainWindow)

def retranslateUi(self, MainWindow):
    _translate = QtCore.QCoreApplication.translate
    MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow"))
    self.pushButton.setText(_translate("MainWindow", "PushButton"))
    self.label.setText(_translate("MainWindow", "15454541"))
    self.menu.setTitle(_translate("MainWindow", "菜单"))
    self.action33.setText(_translate("MainWindow", "打开"))
    self.action_2.setText(_translate("MainWindow", "打开"))

if name == "__main__":

app = QtWidgets.QApplication(sys.argv)
MainWindow = QtWidgets.QMainWindow()
ui = Ui_MainWindow()
ui.setupUi(MainWindow)
MainWindow.show()
sys.exit(app.exec_())

玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/wenda/wd13879.html

相关文章 Recommend

玩蛇网Python互助QQ群,欢迎加入-->: 106381465 玩蛇网Python新手群
修订日期:2017年05月24日 - 19时29分13秒 发布自玩蛇网

您现在的位置: 玩蛇网首页 > Python问题解答 > 正文内容
我要分享到:

必知PYTHON教程 Must Know PYTHON Tutorials

必知PYTHON模块 Must Know PYTHON Modules