469,602 Members | 1,826 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,602 developers. It's quick & easy.

py2exe, library.zip and python.exe

I have converted a Python script using py2exe and have it set to not bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on user)

Thanks, Martin.
Feb 28 '07 #1
3 2823
Martin Evans schrieb:
I have converted a Python script using py2exe and have it set to not bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on user)

Thanks, Martin.

You have to put library.zip on sys.path. Maybe you could create a site.py file
in that directory which can do this, I assume the python.exe will try to load that.

There may be other possibilities as well.

Thomas

Feb 28 '07 #2
Hey,

[Offtopic:] Use PyInstaller...very easy to use - better than py2exe!!

see here:

http://pyinstaller.hpcf.upr.edu/cgi-bin/trac.cgi

Bye,

Matthias
Feb 28 '07 #3
"Thomas Heller" <th*****@ctypes.orgwrote in message
news:ma***************************************@pyt hon.org...
Martin Evans schrieb:
>I have converted a Python script using py2exe and have it set to not
bundle
or compress. The result is my exe and all the support files including
library.zip (exactly as planned - nice job py2exe).

Question: My py2exe application needs to be able to execute extra copies
of
python.exe. I have placed python.exe in the same directory. It obviously
picks up the main python24.dll but how can I configure things so that it
would use the same library.zip for all the library files? This would
save
me having two sets of files.

(The py2exe application happens to be a twisted server app running as a
service which has the ability to launch python scripts as a logged on
user)

Thanks, Martin.

You have to put library.zip on sys.path. Maybe you could create a site.py
file
in that directory which can do this, I assume the python.exe will try to
load that.

There may be other possibilities as well.

Thomas
Many thanks for the tip, it got me thinking. When python.exe is loaded,
sys.path already had python24.zip in it so changing the specified library in
py2exe from the default libary.zip to python24.zip solved it!

Martin
Feb 28 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

20 posts views Thread by Thomas Heller | last post: by
5 posts views Thread by Rene Olsthoorn | last post: by
reply views Thread by David Vaughan | last post: by
2 posts views Thread by garyr | last post: by
1 post views Thread by mitsura | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
1 post views Thread by Jimmy Retzlaff | last post: by
reply views Thread by Larry Bates | last post: by
reply views Thread by Jimmy Retzlaff | last post: by
reply views Thread by guiromero | last post: by
reply views Thread by devrayhaan | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.