python - 如何在 Windows 中将 .ui 转换为 py?

标签 python qt-designer pyuic

我关注了这个link在 Windows 中使用 python 将 .ui 转换为 .py 但它不起作用。我尝试安装 pyuic4 但它不起作用。 python 中是否有任何工具或库可以做到这一点?请建议。

最佳答案

为什么不直接导入呢?

import sys
from PyQt4 import QtGui, uic
app = QtGui.QApplication(sys.argv)
widget = uic.loadUi('demo.ui')
widget.show()
sys.exit(app.exec_())

ps:抱歉我不能在评论区回答。我的声望太低了

关于python - 如何在 Windows 中将 .ui 转换为 py?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40354127/

相关文章:

python - 快速确定中心点和路径的方法

python - Python 中的空间数据热图

python - Qt 设计器 : how to add custom slot and code to a button

python - 如何创建信号以在 Qt Designer 中打开 QFileDialog?

user-interface - 使用 pyuic4 将 UI 文件转换为 Python 问题

python - 如何从 Pandas 日期时间列中提取组件并分配它们

python - 如何使用 Pandas 对一系列值进行编码

qt - 如何使用 Qt Designer 在表单中插入 QChartView?

python - 在pyQt的textEdit中打开文本文件

python - 从 PyQt5 中的 .ui 文件导入自定义小部件