cx_Freeze 3.0.3 review

Download
by rbytes.net on

cx_Freeze module is a set of utilities that can freeze Python scripts into executables in a cross platform way, using many of the tec

License: Python License
File size: 0K
Developer: Anthony Tuininga
0 stars award from rbytes.net

cx_Freeze module is a set of utilities that can freeze Python scripts into executables in a cross platform way, using many of the techniques found in Thomas Heller's py2exe, Gordon McMillan's Installer, and the Freeze utility that ships with Python itself.

Why did I go to the trouble of creating another set of utilities when these three utilities already existed? The Freeze utility that comes with Python itself requires a source distribution, a C compiler and linker which makes for a complex environment for creating executables. In addition, this method is very slow for creating executables as compared to the other methods. py2exe is intended for development on Windows only and cx_Freeze is intended for cross platform development. Installer uses an import hook which means that the development environment and runtime environment are considerably different.

How does it work? A base executable is created which contains code for unpacking the list of frozen modules, starting up the Python interpreter and passing control to the script which is being frozen. When a script is frozen, the script is searched for all references to modules and these modules are then byte compiled and written to the end of the base executable. If the modules that are referenced are extensions written in C, these modules must be included in the path in which the frozen executable is deployed.

Installation:

Extract the archive into a directory. In order to build cx_Freeze you need to have gcc and Python development include files and libraries available. Run the following commands.

python MakeFrozenBases.py
python FreezePython.py --no-copy-deps FreezePython.py

When these commands have completed successfully, the directory will be in the same state as a binary installation. Note that on Windows these scripts assume the presence of a mingw32 installation which can be acquired from http://www.mingw.org.

What's New in This Release:
In Common.c, used MAXPATHLEN defined in the Python OS independent include file rather than the PATH_MAX define which is OS dependent and is not available on IRIX as noted by Andrew Jones.
In the initscript ConsoleSetLibPath.py, added lines from initscript Console.py that should have been there since the only difference between that script and this one is the automatic re-execution of the executable.
Added an explicit "import encodings" to the initscripts in order to handle Unicode encodings a little better. Thanks to Ralf Schmitt for pointing out the problem and its solution.
Generated a meaningful name for the extension loader script so that it is clear which particular extension module is being loaded when an exception is being raised.
In MakeFrozenBases.py, use distutils to figure out a few more platform-dependent linker flags as suggested by Ralf Schmitt.

cx_Freeze 3.0.3 search tags