Possible duplicate:
Is it possible to compile Python for machine code?
Is it possible to compile Python code (plus its dependencies, as well as an interpreter library) into a single Windows executable with the natural (with nothing connected with it) from the Python file? (Like, for example, how the GNU compiler for Java compiles Java into a native (humongous) executable that contains everything in true machine code.)
If so, how do I do this?
(In particular, py2exe
does not do what I want - it includes libraries inside a separate ZIP file and includes the interpreter as a separate DLL.)
Note 1:
To emphasize, I am not asking for a "self-extracting archive", an "executable packer", or any other way of "tricking" by linking files inside exe
- I'm looking for something that really converts Python to its own executable, for example, what GCJ does for java.
Note 2:
Only if this is not possible:
Is it possible, at least, to generate a single executable file from Python code that contains an interpreter included with all library dependencies, so that to execute the executable file you do not need to self-extract to the target disk before launching it?
In this case, the “compilation” requirement is weakened: it doesn’t matter whether the code is really compiled into machine code (it can simply be inserted as a text resource into the target executable file), but the result should nevertheless be the only exe
file [and nothing else], which can work autonomously, especially without the need to unpack / install anything on the target disk before starting.
Mehrdad
source share