Python Forum
How to convert abc.ui into abc.py - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: GUI (https://python-forum.io/forum-10.html)
+--- Thread: How to convert abc.ui into abc.py (/thread-4727.html)



How to convert abc.ui into abc.py - rajeev1729 - Sep-05-2017

How to convert abc.ui into abc.py
for python 3.6.2


RE: How to convert abc.ui into abc.py - Larz60+ - Sep-05-2017

you need to run:
pyuic4 abc.ui -o abc.py
but why don't you use pyQt5: https://pypi.python.org/pypi/pyqt5-installer
or PyQt4 if you need an old version


RE: How to convert abc.ui into abc.py - Litha - Sep-09-2017

Hi everyone
The conversion is bugging me right now, i went to the directory of my ui file then opened a "command prompt window" from there then tried converting:pyuic5 FirstApp.ui -o FirstApp.py, i get a response that "the system cannot find the path specified"

C:\Python\Python35\Lib\site-packages\PyQt5>pyuic5 FirstApp.ui -o FirstApp.py
The system cannot find the path specified.

Please advise Sad :(


RE: How to convert abc.ui into abc.py - snippsat - Sep-09-2017

Save FirstApp.ui in folder where pyuic5.exe is placed PyQt5\Scripts folder.
Then from Scripts folder run same command.

You can also load ui file straight in,then is no need to convert.
from PyQt5 import uic, QtWidgets
import sys

class Ui(QtWidgets.QDialog):
    def __init__(self):
        super().__init__()
        uic.loadUi('FirstApp.ui', self)
        self.show()

if __name__ == '__main__':
    app = QtWidgets.QApplication(sys.argv)
    window = Ui()
    sys.exit(app.exec_())