Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Py2exe: Embed static files in library.zip or exe file itself and transparently access them at runtime

Tags:

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

like image 416
Malcolm Avatar asked Dec 15 '09 01:12

Malcolm


2 Answers

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".

like image 118
Peter Hansen Avatar answered Nov 15 '22 06:11

Peter Hansen


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

Py2exe: Embed static files in exe file itself and access them

like image 21
Darren Bishop Avatar answered Nov 15 '22 05:11

Darren Bishop