Hi

I was create a form in Qt Designer and saved as UR.ui (main title of this forms is "MainWindow") next write in terminal:

pyqt4 UR.ui > UR.py

and open created file UR.py and write:

import sys
from PyQt4 import QtCore, QtGui

from UR import Ui_MainWindow

class StartQT4(QtGui.QMainWindow):
def __init__(self, parent=None):
QtGui.QWidget.__init__(self, parent)

self.ui = Ui_MainWindow()
self.ui.setupUi(self)


if __name__ == "__main__":
app = QtGui.QApplication(sys.argv)
myapp = StartQT4()
myapp.show()
sys.exit(app.exec_())

now when run I have error message "ImportError: cannot import name Ui_MainWindow"

wrrrrrr i have enough.... please help me how run and show this form in python???

Not too many people use the PyQt GUI toolkit, because of licensing problems. My guess is that your installation went wrong, or you misspelled something, imports are case sensitive.

what sneekula said is good. there is an order by which you must install these program so that it works well.i don't know how exactly. so check it well on the internet and then you process.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.