convert ui to py pyqt5 windows, cmd, command prompt
convert ui to py pyqt5 windows, cmd, command prompt

What’s up, Coders? Today we will be learning the to convert .ui file to .py file in PyQt5 PYTHON.

As we all know, PyQt is a free Python cross-platform Graphics User Interface toolkit Qt [also considered as a Python plug-in]. It is developed by the British firm Riverbank Computing. PyQt supports Microsoft Windows as well as various flavours OS including UNIX, Linux and macOS.

Let’s begin right now….

Firstly, don’t forget to install the following modules.

pip install PyQt5
pip install pyqt5-tools

METHOD 1: Use cmd code to convert .ui to .py

Yeah, you can use command prompt code to convert the .ui files into the .py files.

pyuic5 -x "{full_location_of_.ui_file}" -o "{full_location_where_to_create_the_.py_file}"

{full_location_of_.ui_file} : replace this with the location of your .ui file. Example: D:/PyProjects/myFile.ui

{full_location_where_to_create_the_.py_file} : replace this with the location of your .py file. Example: D:/PyProjects/PyFile.py

METHOD 2: Use ‘py to ui converter.py’

It’s the easiest method to convert .ui to .py. You just need to add the directory of .ui file and the directory of .py file. That’s it…..

You will get the following interface when you double click on the converter file.

Location of .ui file: {full_location_of_.ui_file}
Location of new .py or .pyw file: {full_location_where_to_create_the_.py_file}
Converted!!! Happy Pythoning
Press C to continue else to quit… {c to continue} or {else to exit}

Download the PyToUi converter.

Happy Pythoning….

Last modified: October 24, 2019

Author

Comments

Write a Reply or Comment

Your email address will not be published.