[PyQt] Looking for docs of packing PyQt4 app with py2exe

Arthur Pemberton pemboa at gmail.com
Thu Feb 12 09:17:26 GMT 2009


On Thu, Feb 12, 2009 at 2:34 AM, Frédéric
<frederic.mantegazza at gbiloba.org> wrote:
>
> Le 12/2/2009, "Frédéric" <frederic.mantegazza at gbiloba.org> a écrit:
>
>>> I am aware of [1] but I am not clear on how treats resources like
>>> images. I currently have them in the simplest/laziest form -- images
>>> are directly on the filesystem and linked to from within Qt Designer.
>>> So I was hoping for someone to point me to docs on including them
>>> properly in a Qt resource file (and changing my Python code
>>> accordingly) and how this will be affected by py2exe
>>
>>Once you resource file is compiled as a python file, using pyrcc4, you will
>>import it in your app as any other module, so it will be automatically
>>included in the py2exe build process...
>
> Sorry, I was not clear enough... In Designer, you just build resources,
> including the images you need. Then, you use the images from the
> resources, instead of the files, in your widgets.
>
> Then, use pyrcc4 to compile these resources (.qrc) as a python module
> (.py).
>
> Finally, in your code, just use:
>
> from myResources import qInitResources, qCleanupResources
> # Init
> qInitResources()
> # Code
> ...
> # Cleanup
> qCleanupResources()
>
> Hope this helps.

So far things are a lot clear now. One question... is there a `uic`
type module which can load the .qrc directly? Just a curiosity, not a
need.

-- 
Fedora 9 : sulphur is good for the skin
( www.pembo13.com )



More information about the PyQt mailing list