(original) (raw)
This is very old DNA. The persistent user request was a way to bundle up a Python program as a single executable file that could be sent to a friend or colleague and run without first having to install Python. If you Google for python freeze you'll still see old references to it.
I think this was also used as the basis of a similar tool that worked for Windows.
IIRC I did the original version -- it would scan your main program and try to follow all your imports to get a list of modules (yours and stdlib) that would be needed, and it would then byte-compile all of these and produce a huge C file. You would then compile and link that C file with the rest of the Python executable. All extensions would have to be statically linked.
On Sat, Nov 16, 2013 at 9:48 AM, Eric Snow <ericsnowcurrently@gmail.com> wrote:
While looking at something unrelated, I happened to peek at
Python/frozenmain.c and found Py\_FrozenMain(). �I kind of get the idea
of it, but am curious what motivated the addition and who might be
using it. �The function is not documented and doesn't have much
explanation. �I'm guessing that not many are familiar with it (e.g.
http://bugs.python.org/issue15893).
FWIW the function was added quite a while ago (and hasn't been touched
a whole lot since):
changeset: � 1270:14369a5e61679364deeae9a9a0deedbd593a72e0
branch: � � �legacy-trunk
user: � � � �Guido van Rossum <guido@python.org>
date: � � � �Thu Apr 01 20:59:32 1993 +0000
summary: � � Support for frozen scripts; added -i option.
\-eric
\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: https://mail.python.org/mailman/options/python-dev/guido%40python.org
--
--Guido van Rossum (python.org/\~guido)