问题
The Python Doc states:
Frozen modules are modules written in Python whose compiled byte-code object is incorporated into a custom-built Python interpreter by Python’s freeze utility. See Tools/freeze/ for now.
http://docs.python.org/library/imp.html#imp.init_frozen
I don't get it. What is the freeze utility? How can it be used? Why would it be used?
回答1:
This link explains what the Python Freeze utility is in detail: http://wiki.python.org/moin/Freeze
In a nutshell, it creates a portable version of a python script that carries its own built in interpreter (basically like a binary executable), so that you can run it on machines without python.
回答2:
It's similar to tools like py2exe: You can create a single executable that runs a python program without requiring the user to install separate packages, the python interpreter, etc. It is only for Unix/Linux(/possibly OSX) systems though; on Windows you use py2exe for it.
Have a look at http://wiki.python.org/moin/Freeze for more information.
来源:https://stackoverflow.com/questions/9916647/what-is-the-python-freeze-process