tags:

views:

213

answers:

3

Is there a way to have py2exe embed static files (and/or subdirectories of static files) in a library.zip and/or the exe file itself (with zipfile=None) and then transparently access these embedded static files from code at runtime?

Thank you, Malcolm

+2  A: 

This sounds like the recipe you need: Extend py2exe to copy files to the zipfile where pkg_resources can load them

Using that effectively probably requires some knowledge of pkg_resources which is related to (part of) setuptools, whence come "Python Eggs".

Peter Hansen
Thank you Peter.
Malcolm
A: 

Hi Malcolm, hi Peter,

I have same problem but I try to add my files in library.zip and I try to embed this in exe, but I can’t access to it with pkg_resources, could you show me a sample code to it please

Thank you Jean-Michel

jean-michel
@jean-michel, this would best be asked as a new question, making sure that you include part of the code you've written and any error tracebacks you are getting, so people can help you effectively.
Peter Hansen
A: 

Just thought I'd share this here too for the benefit of those still looking for answers:

http://stackoverflow.com/questions/1939883/py2exe-embed-static-files-in-exe-file-itself-and-access-them/3686364#3686364

Darren
Thank you Darren. Regards, Malcolm
Malcolm