What is the Python freeze process?

你说的曾经没有我的故事 提交于 2020-01-14 13:08:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!