0

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???

3
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by nish88
0

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.

0

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.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.