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">
<file alias="wikipedia.jpg">images/wikipedia.jpg</file>
<file alias="icon.jpg">images/icon.jpg</file>

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:

Hope this helps,

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

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
Py2exe-users mailing list

Under the paving stones, the beach