双11狂欢大促

盲盒赢 定制羽绒服

开启惊喜盲盒,抽取你的专属好礼

— 惊喜奖品抢先看 —

求大神!pyqt生成的.ui文件已经转为.py文件,但是如何用python运行?需要加什么代码么???

伤x心x人 伤x心x人 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file 'weibo1.ui'
#
# Created: Thu May 12 11:21:05 2016
# by: PyQt4 UI code generator 4.11.3
#
# WARNING! All changes made in this file will be lost!
import sys
from PyQt4 import QtGui, QtCore


try:
_fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
def _fromUtf8(s):
return s

try:
_encoding = QtGui.QApplication.UnicodeUTF8
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
def _translate(context, text, disambig):
return QtGui.QApplication.translate(context, text, disambig)

class Ui_MainWindow(object):

def setupUi(self, MainWindow):
MainWindow.setObjectName(_fromUtf8("MainWindow"))
MainWindow.resize(800, 600)
self.centralwidget = QtGui.QWidget(MainWindow)
self.centralwidget.setObjectName(_fromUtf8("centralwidget"))
self.checkBox_4 = QtGui.QCheckBox(self.centralwidget)
self.checkBox_4.setGeometry(QtCore.QRect(450, 400, 71, 16))
self.checkBox_4.setObjectName(_fromUtf8("checkBox_4"))
self.T_huati = QtGui.QTextEdit(self.centralwidget)
self.T_huati.setGeometry(QtCore.QRect(210, 340, 311, 31))
self.T_huati.setObjectName(_fromUtf8("T_huati"))
self.checkBox = QtGui.QCheckBox(self.centralwidget)
self.checkBox.setGeometry(QtCore.QRect(210, 400, 71, 16))
self.checkBox.setObjectName(_fromUtf8("checkBox"))
self.L_tishi = QtGui.QLabel(self.centralwidget)
self.L_tishi.setGeometry(QtCore.QRect(210, 320, 121, 16))
self.L_tishi.setObjectName(_fromUtf8("L_tishi"))
self.L_mima = QtGui.QLabel(self.centralwidget)
self.L_mima.setGeometry(QtCore.QRect(210, 260, 54, 12))
self.L_mima.setObjectName(_fromUtf8("L_mima"))
self.buttonBox = QtGui.QDialogButtonBox(self.centralwidget)
self.buttonBox.setGeometry(QtCore.QRect(230, 430, 341, 32))
self.buttonBox.setOrientation(QtCore.Qt.Horizontal)
self.buttonBox.setStandardButtons(QtGui.QDialogButtonBox.Cancel|QtGui.QDialogButtonBox.Ok)
self.buttonBox.setObjectName(_fromUtf8("buttonBox"))
self.T_zhanghao = QtGui.QTextEdit(self.centralwidget)
self.T_zhanghao.setGeometry(QtCore.QRect(280, 200, 111, 31))
self.T_zhanghao.setObjectName(_fromUtf8("T_zhanghao"))
self.checkBox_3 = QtGui.QCheckBox(self.centralwidget)
self.checkBox_3.setGeometry(QtCore.QRect(380, 400, 71, 16))
self.checkBox_3.setObjectName(_fromUtf8("checkBox_3"))
self.pushButton = QtGui.QPushButton(self.centralwidget)
self.pushButton.setGeometry(QtCore.QRect(220, 430, 75, 31))
self.pushButton.setObjectName(_fromUtf8("pushButton"))
self.T_mima = QtGui.QTextEdit(self.centralwidget)
self.T_mima.setGeometry(QtCore.QRect(280, 250, 111, 31))
self.T_mima.setObjectName(_fromUtf8("T_mima"))
self.checkBox_2 = QtGui.QCheckBox(self.centralwidget)
self.checkBox_2.setGeometry(QtCore.QRect(290, 400, 71, 16))
self.checkBox_2.setObjectName(_fromUtf8("checkBox_2"))
self.L_zhanghao = QtGui.QLabel(self.centralwidget)
self.L_zhanghao.setGeometry(QtCore.QRect(210, 210, 54, 12))
self.L_zhanghao.setObjectName(_fromUtf8("L_zhanghao"))
MainWindow.setCentralWidget(self.centralwidget)
self.menubar = QtGui.QMenuBar(MainWindow)
self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 23))
self.menubar.setObjectName(_fromUtf8("menubar"))
MainWindow.setMenuBar(self.menubar)
self.statusbar = QtGui.QStatusBar(MainWindow)
self.statusbar.setObjectName(_fromUtf8("statusbar"))
MainWindow.setStatusBar(self.statusbar)

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

def retranslateUi(self, MainWindow):
MainWindow.setWindowTitle(_translate("MainWindow", "MainWindow", None))
self.checkBox_4.setText(_translate("MainWindow", "点赞", None))
self.checkBox.setText(_translate("MainWindow", "转发", None))
self.L_tishi.setText(_translate("MainWindow", "请输入感兴趣的话题", None))
self.L_mima.setText(_translate("MainWindow", "密码", None))
self.checkBox_3.setText(_translate("MainWindow", "收藏", None))
self.pushButton.setText(_translate("MainWindow", "多用户登录", None))
self.checkBox_2.setText(_translate("MainWindow", "评论", None))
self.L_zhanghao.setText(_translate("MainWindow", "微博账号", None))

...全文

相关推荐

PyQt5如何将.ui文件转换为.py文件的实例代码

主要介绍了PyQt5之如何将.ui文件转换为.py文件,本文通过实例代码给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友可以参考下

weixin_38571449

Python+PyCharm 运用PyQt5及将.ui文件转换为.py文件(内含出错解决方法)

Python+PyCharm中添加Pyqt5,可视化制作生成表单添加常用组件,不用再手动敲代码。

IF先生

解决.ui文件生成的.py文件运行不出现界面的方法

今天小编就为大家分享一篇解决.ui文件生成的.py文件运行不出现界面的方法,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

weixin_38596267

Pycharm pyuic5实现将ui文件转为py文件,让UI界面成功显示

主要介绍了Pycharm pyuic5实现将ui文件转为py文件,让UI界面成功显示,具有很好的参考价值,希望对大家有所帮助。一起跟随小编过来看看吧

weixin_38747211

PyQt5的安装配置过程,将ui文件转为py文件后显示窗口的实例

PyQt5安装 在cmd下输入pip install PyQt5 完成PyQt5安装, 安装完成后,在python安装目录下可以看到 配置PyCharm 配置PyCharm是为了在Pycharm里面实现打开qt designer,然后生成qt文件,然后将qt文件转换成python语言的软件文件。 打开Pycharm,按下图操作 打开Extrernal Tools之后,点击上如绿色的+,添加Tools Name:自定义 Program:指向上述安装PyQt5-tools里面的designer.exe Work directory:使用变量 $FileDir$ 然后再新建多一个“PyUIC”,

weixin_38514660
评论 6
收藏 已收藏
分享
返回顶部
伤x心x人
脚本语言 37,738 成员 34,208 内容