# cxfreeze script

The cxfreeze script is included with other Python scripts. On Windows and the Mac this is in the Scripts subdirectory of your Python installation whereas on Unix platforms this in the bin directory of the prefix where Python is installed.

Assuming you have a script called hello.py which you want to turn into an executable, this can be accomplished by this command:

cxfreeze hello.py --target-dir dist


Further customization can be done using the following options:

option name description
--version show version number and exit
-h, --help show this help message and exit
-O optimize generated bytecode as per PYTHONOPTIMIZE; use -OO in order to remove doc strings
-c, --compress compress byte code in zip files
-s, --silent suppress all output except warnings
--base-name file on which to base the executable; if the name of the file is not an absolute file name, the subdirectory bases inside the cx_Freeze package will be searched for a file matching the name, without regard to the extension
--init-script script which will be executed upon startup; if the name of the file is not an absolute file name, the subdirectory initscripts inside the cx_Freeze package will be searched for a file matching the name, without regard to the extension
--target-dir directory in which to place the executable and any dependent files
--target-name the name of the file to create; the default is the base name of the script and the extension of the base executable name
--shared-name the name of the file to create; the default is the base name of the script and the extension of the base executable name
--no-copy-deps do not copy any dependent files (extensions, shared libraries, etc.) to the target directory; this also modifies the default init script to ConsoleKeepPath and means that the target executable requires a Python installation to execute properly
--default-path list of paths separated by the standard path separator for the platform which will be used to initialize the search path instead of sys.path
--include-path list of paths separated by the standard path separator for the platform which will be used to add to the search path
--replace-paths replace all the paths in modules found in the given paths with the given replacement string; multiple values are separated by the standard path separator for the platform and each value is of the form <search>=<replace>; <search> can be * which means all paths not already specified
--include-modules comma separated list of names of modules to include
--exclude-modules comma separated list of names of modules to exclude
--ext-list-file name of file in which to place the list of dependent files which were copied to the target directory
-z, --zip-include name of file to add to the zip file or a specification of the form <name>=<arcname> which will specify the archive name to use; multiple --zip-include arguments can be used