Python Forum
How to convert abc.ui into abc.py
Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to convert abc.ui into abc.py
#1
How to convert abc.ui into abc.py
for python 3.6.2
Reply
#2
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
Reply
#3
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 :(
Reply
#4
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_())
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020