Re: [Python-Dev] What's the story on Py_FrozenMain?
On Sat, Nov 16, 2013 at 10:55 AM, M.-A. Lemburg wrote: > It's used as main()-function for frozen Python interpreters. > > See eGenix PyRun as an example and the freeze tool in Tools/freeze/ > for the implementation that uses this API: > > http://www.egenix.com/products/python/PyRun/ On Sat, Nov 16, 2013 at 10:57 AM, Guido van Rossum wrote: > 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. > > 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. > > I think this was also used as the basis of a similar tool that worked for > Windows. > > Nowadays installers are much more accessible and easier to use, and Python > isn't so new and unknown any more, so there's not much demand left. Thanks for the explanations. It's interesting stuff. :) -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/archive%40mail-archive.com
Re: [Python-Dev] What's the story on Py_FrozenMain?
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. 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. I think this was also used as the basis of a similar tool that worked for Windows. Nowadays installers are much more accessible and easier to use, and Python isn't so new and unknown any more, so there's not much demand left. --Guido On Sat, Nov 16, 2013 at 9:48 AM, Eric Snow 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 > date:Thu Apr 01 20:59:32 1993 + > 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) ___ 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/archive%40mail-archive.com
Re: [Python-Dev] What's the story on Py_FrozenMain?
On 16.11.2013 18:48, Eric Snow 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 > date:Thu Apr 01 20:59:32 1993 + > summary: Support for frozen scripts; added -i option. It's used as main()-function for frozen Python interpreters. See eGenix PyRun as an example and the freeze tool in Tools/freeze/ for the implementation that uses this API: http://www.egenix.com/products/python/PyRun/ -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from the Source (#1, Nov 16 2013) >>> Python Projects, Consulting and Support ... http://www.egenix.com/ >>> mxODBC.Zope/Plone.Database.Adapter ... http://zope.egenix.com/ >>> mxODBC, mxDateTime, mxTextTools ...http://python.egenix.com/ 2013-11-19: Python Meeting Duesseldorf ... 3 days to go : Try our mxODBC.Connect Python Database Interface for free ! :: eGenix.com Software, Skills and Services GmbH Pastor-Loeh-Str.48 D-40764 Langenfeld, Germany. CEO Dipl.-Math. Marc-Andre Lemburg Registered at Amtsgericht Duesseldorf: HRB 46611 http://www.egenix.com/company/contact/ ___ 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/archive%40mail-archive.com
[Python-Dev] What's the story on Py_FrozenMain?
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 date:Thu Apr 01 20:59:32 1993 + 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/archive%40mail-archive.com