py2exe, library.zip and python.exe

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Martin Evans

    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.


  • Thomas Heller

    #2
    Re: py2exe, library.zip and python.exe

    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

    Comment

    • Matthias Vodel

      #3
      Re: py2exe, library.zip and python.exe

      Hey,

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

      see here:



      Bye,

      Matthias

      Comment

      • Martin Evans

        #4
        Re: py2exe, library.zip and python.exe

        "Thomas Heller" <theller@ctypes .orgwrote in message
        news:mailman.45 09.1172662567.3 2031.python-list@python.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


        Comment

        Working...