Acapulka
Acapulka

Reputation: 79

Converting .ui to .py

I'm trying to create my very first gui via Pyqt 5, and python 3.6

I created the interface in Qt designer ,got needed .ui file and now want to translate it to .py. I found that it could be done with pyui5, but can't find how.

Used this to start .ui through python:

app = QApplication(sys.argv)
widget = loadUi('D:\test.ui')
widget.show()
sys.exit(app.exec_())

But I can't change anything in code,so transformation from .ui to .py is needed. Pyuic5 command in cmd is not working.

Thank you in advance!

Upvotes: 1

Views: 4792

Answers (3)

Harvindar Singh
Harvindar Singh

Reputation: 21

I have created an Application to convert the .ui (Pyqt5 Created by qt designer) file to py.

you can convert your file easily using this application Direct Download Link: https://download1653.mediafire.com/utmxc4pza7ug/1f0gkwk6577g7fi/Ui+to+Py.zip

Mediafire link to download: https://www.mediafire.com/file/1f0gkwk6577g7fi/Ui_to_Py.zip/file

you check the source code of the application on my GitHub: https://github.com/Harvindar994/

Upvotes: 0

Acapulka
Acapulka

Reputation: 79

Well, I solved the problem. I installed pyqt via pip, after that found pyuic5.bat in Library/Bin folder. Then transformed with it .ui to .py

Upvotes: 1

Liam
Liam

Reputation: 6429

You should use pyuic4 command: pyuic4 input.ui -o output.py

Upvotes: 0

Related Questions