https://www.jetbrains.com/pycharm/download/#section=windows
https://www.riverbankcomputing.com/software/pyqt/download
pyuic4 ui_name.ui > py_name.py
@echo off
@cd /d "%~dp0"
pyuic4 %1 > %~n1.py
将ui文件拖入批处理即可,生成在ui文件所在目录,文件名为py_name.pyimport sys
Ui_MainWidonw(object)
中的object修改成修改成QtGui.QMainWindow
def __init__(self):
super(Ui_MainWindow,self).__init__()
self.setupUi(self)
self.retranslateUi(self)
app = QtGui.QApplication(sys.argv)
win = Ui_MainWindow()
win.show()
app.exec_()
原文:http://www.cnblogs.com/wakerwu/p/6759786.html