[PyQt] pyuic4 vs uic.loadUI

David Douard david.douard at logilab.fr
Wed Sep 29 11:16:38 BST 2010

>   Hmm interesting topic, I recently had to switch back from ui files to
> py files because I couldnt get py2exe to package the ui files correctly
> (Any help appreciated though)

I usually use both of them to deal with this problem.

My python code which depends on ui files (ie. class which heritate from 
widgets made in designer) tries to load ui file using uic.loadUI, and if it 
fails, it tries to load the class from the module made by pyuic4.

This allows me to use .ui files directly during development process. Then when 
I must release the code, the setup.py generates the python modules from ui 
file (using pyuic4), and these modules are packaged by distutils (which is 
used for py2exe or to build debian packages).

This king of stuff is used for example in hgview 

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://www.riverbankcomputing.com/pipermail/pyqt/attachments/20100929/5326848e/attachment.pgp>

More information about the PyQt mailing list