0

i have been using qtdesigner with pyqt4 and python3.4. I was able to convert .ui files to .py files by using:

C:/Python34/Lib/site-packages/PyQt4/pyuic4.bat -x myfile.ui -o myfile.py

But now it has stopped working!!

The .py file is never generated. my cmd shows no error.

I also noticed that my pyuic4.bat file is 0 kb in size.

JosefZ
  • 28,460
  • 5
  • 44
  • 83
  • 1
    Welcome to StackOverflow , Please read [How to create a Minimal, Complete, and Verifiable example](http://stackoverflow.com/help/mcve) – Ilyes Jan 23 '17 at 14:31
  • 3
    If your batch-file is 0kb in size then it is **empty**! Redownload it or get it from whereever you had it. Of course there will not be done anything in cmd as it is an empty script. And an empty script will not create a .py file either... – geisterfurz007 Jan 23 '17 at 14:43

1 Answers1

0

this bat-file is just executing python. try using:

python -m PyQt4.uic.pyuic -o dest.py src.ui
python -m PyQt5.uic.pyuic -o dest.py src.ui

(see here for more options)

or consider coversion during script-start using:

from PyQt4/5.uic import compileUiDir
compileUiDir( './relative/path/to/folder/with/ui-file' )

or for single files:

from PyQt4/5.uic import compileUi
compile_ui('path/to/dir', 'file-name')
Skandix
  • 1,916
  • 6
  • 27
  • 36