Qt Designer UI to python file export

.ui to .py file conversion
Qt designer is a designer for GUI. We can designs in it and then save them as a .ui file. When you are working with PyQt5 for making GUI in python, you have to export the .ui file to a .py file. We can do this by using qt-tools. pyuic5 command is used in Python to do this. Go to the path where the ui is saved and enter the below command.

pyuic5 command to convert .ui to .py


$ pyuic5 xyz.ui -o xyz.py

Note: Edit the xyz.ui with the UI file name and xyz.ui with the python file name you want to give to the design in the above command.


To setup complete PyQt5 with Qt tools and install Qt Designer,
Click here

So, I think that's it for this post... See you in the next.

3 Comments