Blog (or) Scribble Pad

pyQt: ui file to py file conversion in windows

Once the anyfile.ui file is saved then it could be converted into anyfile.py file using uic.py script. 

Step 1: Download and install PySide.
Step 2: Open your command prompt and head to the directory where the installed PySide scripts were located on your computer like in mine, C:\Python27\Lib\site-packages\PySide\scripts
Step 3: Now type the command 'python uic.py input.ui -o output.py -x', in which you have to only change the input and output file names. For me this command worked 'C:\Python27\Lib\site-packages\PySide\scripts>python uic.py D:\PyEx\sam.ui -o D:\PyEx\output.py -x'
Note: It would be easier if the ui file to be converted is saved in the same directory as the uic.py file.
Step 4: Open, run and verify the output py file and have a self five.