py2exe, library.zip and python.exe

Discussion in 'Python' started by Martin Evans, Feb 28, 2007.

  1. Martin Evans

    Martin Evans Guest

    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.
     
    Martin Evans, Feb 28, 2007
    #1
    1. Advertising

  2. 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
     
    Thomas Heller, Feb 28, 2007
    #2
    1. Advertising

  3. Matthias Vodel, Feb 28, 2007
    #3
  4. Martin Evans

    Martin Evans Guest

    "Thomas Heller" <> wrote in message
    news:...
    > 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
     
    Martin Evans, Feb 28, 2007
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sunil_varma
    Replies:
    1
    Views:
    1,280
  2. Timothy Smith

    py2exe and library.zip

    Timothy Smith, May 3, 2005, in forum: Python
    Replies:
    16
    Views:
    801
  3. python
    Replies:
    3
    Views:
    1,883
    Simon Brunning
    May 22, 2006
  4. Laszlo Nagy

    I want py2exe not to create library.zip

    Laszlo Nagy, Sep 12, 2007, in forum: Python
    Replies:
    7
    Views:
    2,604
    Grant Edwards
    Sep 13, 2007
  5. m.niinimaki
    Replies:
    9
    Views:
    1,107
    steph
    Aug 29, 2010
Loading...

Share This Page