py2exe questions

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Doug Stell

    py2exe questions

    I have 2 questions about py2exe or any similar utility.

    1. Is it possible to create a single Windows executable that does not
    blow out to a folder full of files and can be called from scripts
    using command line arguments?

    2. If the above can be done, it is possible to hide parts of the
    Python source code from users? These users are software developers,
    but we don't want them to see how the code does what it does.

    thanks, doug
  • Grant Edwards

    #2
    Re: py2exe questions

    On 2006-11-03, Doug Stell <celiadoug@mchs i.comwrote:
    I have 2 questions about py2exe or any similar utility.
    >
    1. Is it possible to create a single Windows executable that does not
    blow out to a folder full of files and can be called from scripts
    using command line arguments?
    The default operation of py2exe already meets requirement 1b:
    an executable that can be called from scripts using command
    line arguments.

    --
    Grant Edwards grante Yow! Now I'm concentrating
    at on a specific tank battle
    visi.com toward the end of World
    War II!

    Comment

    • Larry Bates

      #3
      Re: py2exe questions

      Doug Stell wrote:
      I have 2 questions about py2exe or any similar utility.
      >
      1. Is it possible to create a single Windows executable that does not
      blow out to a folder full of files and can be called from scripts
      using command line arguments?
      >
      2. If the above can be done, it is possible to hide parts of the
      Python source code from users? These users are software developers,
      but we don't want them to see how the code does what it does.
      >
      thanks, doug
      py2exe reduce the number of files you need to distribute down to 4:

      msvcr71.dll
      w9xpopen.exe (Windows/98 support)
      library.zip (all .pyo, .pyd, and .dll files)
      applcation.exe


      I does not however go to great lengths to "hide" the code from
      someone with time/expertise that wants to get to your code
      (but then just about anything can be disassembled). The compiled
      ..pyo files are just placed in library.zip. At least it doesn't
      send your .py files along.

      -Larry

      Comment

      • Thomas Heller

        #4
        Re: py2exe questions

        Larry Bates schrieb:
        Doug Stell wrote:
        >I have 2 questions about py2exe or any similar utility.
        >>
        >1. Is it possible to create a single Windows executable that does not
        >blow out to a folder full of files and can be called from scripts
        >using command line arguments?
        >>
        >2. If the above can be done, it is possible to hide parts of the
        >Python source code from users? These users are software developers,
        >but we don't want them to see how the code does what it does.
        >>
        >thanks, doug
        >
        py2exe reduce the number of files you need to distribute down to 4:
        >
        msvcr71.dll
        w9xpopen.exe (Windows/98 support)
        library.zip (all .pyo, .pyd, and .dll files)
        applcation.exe
        It can easily be reduced to 2 files by 'embedding' the libray.zip
        into the exe (use the zipfile=None option), and deleting the w9xpopen.exe
        if you don't need win98 support.
        I does not however go to great lengths to "hide" the code from
        someone with time/expertise that wants to get to your code
        (but then just about anything can be disassembled). The compiled
        .pyo files are just placed in library.zip. At least it doesn't
        send your .py files along.
        Thomas

        Comment

        • robert

          #5
          Re: py2exe questions

          Thomas Heller wrote:
          Larry Bates schrieb:
          >Doug Stell wrote:
          >>I have 2 questions about py2exe or any similar utility.
          >>>
          >>1. Is it possible to create a single Windows executable that does not
          >>blow out to a folder full of files and can be called from scripts
          >>using command line arguments?
          >>>
          >>2. If the above can be done, it is possible to hide parts of the
          >>Python source code from users? These users are software developers,
          >>but we don't want them to see how the code does what it does.
          >>>
          >>thanks, doug
          >py2exe reduce the number of files you need to distribute down to 4:
          >>
          >msvcr71.dll
          >w9xpopen.exe (Windows/98 support)
          >library.zip (all .pyo, .pyd, and .dll files)
          >applcation.e xe
          >
          It can easily be reduced to 2 files by 'embedding' the libray.zip
          into the exe (use the zipfile=None option), and deleting the w9xpopen.exe
          if you don't need win98 support.
          and finally you can use Python2.3 to avoid msvcr71.dll

          -robert

          Comment

          • Jerry

            #6
            Re: py2exe questions

            The McMillan (sp?) Python Installer has recently been resurrected as
            well, though now, it is just called PyInstaller and can be found at


            It allows you to create a one file distributable without the need to go
            back to Python2.3.

            Despite what everyone is saying though, I believe that any and all
            solutions will require that the byte-code be extracted to some
            directory before being run. It's not as though you are REALLY
            compiling the language to native code. It's just a bootstrap around
            the Python interpreter and your code plus any modules that it needs to
            run.

            --
            Jerry

            Comment

            • Fredrik Lundh

              #7
              Re: py2exe questions

              Jerry wrote:
              Despite what everyone is saying though, I believe that any and all
              solutions will require that the byte-code be extracted to some
              directory before being run.
              the Python interpreter doesn't really care what you believe, though;
              it's perfectly capable of executing byte code that's stored in memory
              buffers.

              </F>

              Comment

              • Marc 'BlackJack' Rintsch

                #8
                Re: py2exe questions

                In <1162646535.744 282.95290@m7g20 00cwm.googlegro ups.com>, Jerry wrote:
                Despite what everyone is saying though, I believe that any and all
                solutions will require that the byte-code be extracted to some
                directory before being run.
                It's not Python bytecode. The problem is native libraries which are hard
                to run from memory without a real file backing it on some platforms. A
                pure Python program/package should be possible without temporary files.

                Ciao,
                Marc 'BlackJack' Rintsch

                Comment

                • Thomas Heller

                  #9
                  Re: py2exe questions

                  Marc 'BlackJack' Rintsch schrieb:
                  In <1162646535.744 282.95290@m7g20 00cwm.googlegro ups.com>, Jerry wrote:
                  >
                  >Despite what everyone is saying though, I believe that any and all
                  >solutions will require that the byte-code be extracted to some
                  >directory before being run.
                  >
                  It's not Python bytecode. The problem is native libraries which are hard
                  to run from memory without a real file backing it on some platforms. A
                  pure Python program/package should be possible without temporary files.
                  py2exe even achives this on Windows. See http://www.py2exe.org/old/ ,
                  and look at the section named "The bundle option". py2exe is able to
                  load Python extensions (.pyd and .dll) from the zip-archive *without*
                  extracting them to the file system at all. It doesn't work for the C
                  runtime library msvcr71.dll though.

                  Thomas

                  Comment

                  • timmy

                    #10
                    Re: py2exe questions

                    Doug Stell wrote:
                    I have 2 questions about py2exe or any similar utility.
                    >
                    1. Is it possible to create a single Windows executable that does not
                    blow out to a folder full of files and can be called from scripts
                    using command line arguments?
                    py2exe can most certainly do this.
                    >
                    2. If the above can be done, it is possible to hide parts of the
                    Python source code from users? These users are software developers,
                    but we don't want them to see how the code does what it does.
                    >
                    thanks, doug
                    you can make a single exe in py2exe which would make it harder to
                    disassemble, but there's no such thing in the software world that makes
                    it impossible.

                    Comment

                    Working...