Re: Directly Executable Files in Python

Discussion in 'Python' started by harrismh777, Mar 29, 2011.

  1. harrismh777

    harrismh777 Guest

    Chris Rebert wrote:
    > Yes. py2exe is a tool which generates such Windows executables:
    > http://www.py2exe.org/


    Interesting... but it can't possibly be creating .exe files
    (compiling)... I don't buy it... it has to be reproducing the byte code
    interpreter in the code segment and the byte code in the data segment...
    so that each .exe file created by said process is actually loading an
    entire copy of at least the byte code interpreter with each program
    "compiled" ... can't be very efficient??

    .... just a question?
     
    harrismh777, Mar 29, 2011
    #1
    1. Advertising

  2. On Tue, Mar 29, 2011 at 12:16 AM, harrismh777 <> wrote:
    > Chris Rebert wrote:
    >>
    >> Yes. py2exe is a tool which generates such Windows executables:
    >> http://www.py2exe.org/

    >
    > Interesting... but it can't possibly be creating .exe files (compiling).... I
    > don't buy it... it has to be reproducing the byte code interpreter in the
    > code segment and the byte code in the data segment... so that each .exe file
    > created by said process is actually loading an entire copy of at least the
    > byte code interpreter with each program "compiled" ...  can't be very
    > efficient??
    >
    > ... just a question?


    If you can figure out a good way to compile a language like Python,
    you'll be very rich. Yes, it is running the interpreter and then
    running the bytecode on the interpreter. It's the same way Java and
    ..NET work.
     
    Benjamin Kaplan, Mar 29, 2011
    #2
    1. Advertising

  3. harrismh777

    Paul Rudin Guest

    Benjamin Kaplan <> writes:


    > If you can figure out a good way to compile a language like Python,
    > you'll be very rich. Yes, it is running the interpreter and then
    > running the bytecode on the interpreter. It's the same way Java and
    > .NET work.


    Not exactly AIUI. .NET bytecodes do actually get compiled to executable code
    before being executed (unless things have changed recently - I haven't
    really done anything significant with .NET in the last couple of years).
     
    Paul Rudin, Mar 29, 2011
    #3
  4. harrismh777

    Ethan Furman Guest

    harrismh777 wrote:
    > Chris Rebert wrote:
    >> Yes. py2exe is a tool which generates such Windows executables:
    >> http://www.py2exe.org/

    >
    > Interesting... but it can't possibly be creating .exe files
    > (compiling)...


    Yes and no. The python program is not being compiled. The Python
    system, along with all the necessary libraries and support .py files,
    are combined into a .exe loader. When the .exe is run it extracts the
    Python interpreter, makes all the other files available, and then starts
    it running.*

    ~Ethan~

    *The details are not exact, but this is the general idea.
     
    Ethan Furman, Mar 29, 2011
    #4
  5. On 2011-03-29, harrismh777 <> wrote:
    > Chris Rebert wrote:
    >> Yes. py2exe is a tool which generates such Windows executables:
    >> http://www.py2exe.org/

    >
    > Interesting... but it can't possibly be creating .exe files


    It is.

    > (compiling)...


    It isn't.

    > I don't buy it...


    Then don't.

    > it has to be reproducing the byte code interpreter in the code
    > segment and the byte code in the data segment...


    Something like that.

    --
    Grant Edwards grant.b.edwards Yow! Either CONFESS now or
    at we go to "PEOPLE'S COURT"!!
    gmail.com
     
    Grant Edwards, Mar 29, 2011
    #5
  6. harrismh777

    CM Guest


    > it has to be reproducing the byte code
    > interpreter in the code segment and the byte code in the data segment...
    > so that each .exe file created by said process is actually loading an
    > entire copy of at least the byte code interpreter with each program
    > "compiled" ...


    Yes, if you think of it as a handy packager and not a compiler, it
    makes sense.

    > can't be very efficient??


    How do you define efficient? All I know is that it works well. You
    click on
    the .exe and a moment later you are running the application despite
    not having
    Python installed on your computer. I'm grateful for its existence.

    Che
     
    CM, Mar 29, 2011
    #6
  7. harrismh777

    CM Guest

    On Mar 29, 12:16 am, harrismh777 <> wrote:
    > Chris Rebert wrote:
    > > Yes. py2exe is a tool which generates such Windows executables:
    > >http://www.py2exe.org/

    >
    > Interesting... but it can't possibly be creating .exe files
    > (compiling)... I don't buy it... it has to be reproducing the byte code
    > interpreter in the code segment and the byte code in the data segment...
    > so that each .exe file created by said process is actually loading an
    > entire copy of at least the byte code interpreter with each program
    > "compiled" ...  


    Yes, if you think of it as a handy packager and not a compiler, it
    makes sense.

    > can't be very efficient??


    How do you define efficient? All I know is that it works well. You
    click on the .exe and a moment later you are running the application
    despite not having Python or any of the third party libraries you've
    used installed on your computer. I'm grateful for its existence.
     
    CM, Mar 29, 2011
    #7
    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. Replies:
    3
    Views:
    1,519
    Malte
    Mar 9, 2005
  2. Replies:
    15
    Views:
    511
    Dave Thompson
    Aug 21, 2006
  3. pratap
    Replies:
    20
    Views:
    791
    Flash Gordon
    Mar 7, 2007
  4. Jason Cavett
    Replies:
    8
    Views:
    658
    Sanjay
    May 16, 2007
  5. Replies:
    0
    Views:
    462
Loading...

Share This Page