Question

I have viewed quite a few SO threads on this topic, but none of them have proven very helpful. I am trying to make a single executable file that will run on the system of someone who does not have python installed. My program uses wxpython. Everything else works, but I cannot manage to embed an image inside the exe file (and not just in the dist folder), and load it from the program. I believe that it is possible to do this. How should I do this in my py2exe setup, and how should I access the embedded file from the python program?

Was it helpful?

Solution

py2exe may not support this. However, you can use wxPython's img2py utility to convert your image into an importable Python file. Then you should be able to "embed" the images that way. Here are some links on how to use the img2py utility:

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top