1

I am unable to use the command prompt due to security restrictions on my work PC and I am trying unsuccessfully to find a way to convert .ui files to .py without the pyuic4 batch file.

I have found the uic/pyuic.py program but have been unsuccessful in my attempts to run it from a python console.

Any help with this would be great.

Cheers.

1
  • Use the uic module. Commented May 5, 2016 at 15:48

1 Answer 1

2

Thanks ekhumoro,

Was able to implement the uic successfully, using compileUiDir, since I have multiple .ui files. Final code was:

from PyQt4 import uic
folderToConvert = r'filePathGoesHere'
uic.compileUiDir(folderToConvert,recurse=False)

This is a .py file that I run or call/execute prior to running the main program. Very handy!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.