问题
I really like the PY2EXE module, it really helps me share scripts with other co-workers that are super easy for them to use.
My question is: when the PY2EXE module compiles the code into an executable, does the resulting executable process faster?
Thanks for any replies!
回答1:
py2exe just bundles the Python interpreter and all the needed libraries into the executable and a few library files. When you run the executable, it uses the bundled interpreter to run your script.
Since it doesn't actually generate native code, the speed of execution should be about the same, possibly slower because of the overhead of everything being packaged up.
回答2:
Partly, it bundles the python environment with the 'precompiled' pyc files. These are already parsed into python byte code but they aren't native speed executables
来源:https://stackoverflow.com/questions/12056702/does-py2exe-compile-a-python-code-to-run-faster