2014年9月29日 星期一

[Python] Generate executable binary in Linux

Freezing Your Code — The Hitchhiker's Guide to Python
http://docs.python-guide.org/en/latest/shipping/freezing/

How can I create a stand-alone binary from a Python script?
http://effbot.org/pyfaq/how-can-i-create-a-stand-alone-binary-from-a-python-script.htm



Freeze.py

What is the Python freeze process? - Stack Overflow
http://stackoverflow.com/questions/9916647/what-is-the-python-freeze-process

30.1. imp — Access the import internals — Python 2.7.8 documentation
https://docs.python.org/2/library/imp.html#imp.init_frozen

Freeze - Python Wiki
https://wiki.python.org/moin/Freeze

python/freeze.py at master · python-git/python · GitHub
https://github.com/python-git/python/blob/master/Tools/freeze/freeze.py

[projects] Index of /python/trunk/Tools/freeze
http://svn.python.org/view/python/trunk/Tools/freeze/

ubuntu - Error in using Python freeze.py - Stack Overflow
http://stackoverflow.com/questions/20313886/error-in-using-python-freeze-py

Ubuntu 13.10
  1. sudo apt-get install python2.7-examples
    The one mark in red is the freeze.py we need.
    dpkg -S freeze.py
    python-pip: /usr/share/pyshared/pip/commands/freeze.py
    python-pip: /usr/lib/python2.7/dist-packages/pip/commands/freeze.py
    python2.7-examples: /usr/share/doc/python2.7/examples/Tools/freeze/makefreeze.py
    python2.7-examples: /usr/share/doc/python2.7/examples/Tools/freeze/freeze.py
  2. sudo ln -s /usr/lib/python2.7/config-x86_64-linux-gnu/ /usr/lib/python2.7/config
  3. python /usr/share/doc/python2.7/examples/Tools/freeze/freeze.py test.py
  4. make
  5. If make finished successfully, the executable binary should be available at ./test.

cxfreeze script — cx_Freeze 5.0 documentation
http://cx-freeze.readthedocs.org/en/latest/script.html#script