On Fri, Mar 1, 2013 at 6:15 PM, Dave Brotherstone email@example.com wrote:
I'm pretty sure this "just works", you put the name of the zip file in sys.path, then it will internally open the zip (without extracting to a temp location) and search for the relevant module - I don't know much (read: anything) about Py_SetPath, but I'm assuming it's the same.
Yes, it seems to work but apparently all the dynamic libraries cannot be inside the zip archive (why?).
Here's what I have done:
first put all the files (*.py) from Python stdlib into a zip archive (I put them straight into archive, i.e. no parent directory, like: stdlib.zip/base64.py)
copy all the files from "lib-dynload" to the folder where you put that zip from previous line
Py_SetPath() to something line "parent/stdlib.zip:parent/lib-dynload".
So basically it treats the zip file as a directory. Note, that it needs zlib in order to look inside the zip - it is in lib-dynload however - I'm just saying in case someone wouldn't all the dynamic libraries.
Feel free to let me know if it works for you!