Hi Alex,

pyrcc4 will do the work for you. It encodes all images you specify on resources.qrc and generates qrc_resources.py, that contains the images.

Just create resources.qrc as in the following sample

<!DOCTYPE RCC><RCC version="1.0">
<qresource>
<file alias="wikipedia.jpg">images/wikipedia.jpg</file>
<file alias="icon.jpg">images/icon.jpg</file>
...
</qresource>
</RCC>


then run the command
$pyrcc4 -o qrc_resources.py resources.qrc

and now you have all images on a file (you can delete images/ dir, on the above scenario)

On your code you refer to the images with a ":/" prefix, eg:
 self.Button.setIcon(QtGui.QIcon(":/wikipedia.jpg"))

Hope this helps,
Regards




On Thu, Jul 17, 2008 at 3:45 AM, Alex Bryan <alexnbryan@gmail.com> wrote:
Hello

This is my first post to this list, but here's my problem. When I use
py2exe to compile my program everything runs fine on my computer. But
lets say I go to another computer in my house and put the .exe on that
computer, I get errors. The reason for the errors is because I have
images that i have put into the program, along with the .ico file for
the title bar icon. My Question is how can I make those image and icon
files compile with the exe? I would prefer not to just like change the
directory of the images to the exe's directory. Is there a better way?

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Py2exe-users mailing list
Py2exe-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/py2exe-users



--
Under the paving stones, the beach