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 --script hello.py --target-dir dist

Further customization can be done using the following options:

--script=NAME#

script which will be turned into an executable

--init-script=NAME#

script which will be executed upon startup; if the name of the file is not an absolute file name, the subdirectory initscripts (rooted in the directory in which the cx_Freeze package is found) will be searched for a file matching the name

--base=NAME, --base-name=NAME#

the name of the base executable; the pre-defined values are: “console” (default), “gui” and “service”; a user-defined base is accepted if it is given with an absolute path name

--target-name=NAME#

the name of the target executable; the default value is the name of the script; it is recommended NOT to use an extension (automatically added on Windows); target-name with version is supported; if specified a path, raise an error

--icon=ICON#

name of icon which should be included in the executable itself on Windows (ignored by Python app from Microsoft Store) or placed in the target directory for other platforms; it is recommended NOT to use an extension (automatically added “.ico” on Windows, “.icns” on macOS and “.png” or “.svg” on Linux and others)

--manifest=NAME#

the name of manifest which should be included in the executable itself (Windows only - ignored by Python app from Microsoft Store)

--uac-admin#

creates a manifest for an application that will request elevation (Windows only - ignored by Python app from Microsoft Store)

--uac-uiaccess#

changes the application manifest to bypass user interface control (Windows only - ignored by Python app from Microsoft Store)

--shortcut-name=NAME#

the name to give a shortcut for the executable when included in an MSI package (Windows only)

--shortcut-dir=DIR#

the directory in which to place the shortcut when being installed by an MSI package; see the MSI Shortcut table documentation for more information on what values can be placed here (Windows only)

the copyright value to include in the version resource associated with executable (Windows only)

--trademarks#

the trademarks value to include in the version resource associated with the executable (Windows only)

--version#

show version number and exit

-h, --help#

show this help message and exit

New in version 6.10: manifest and uac-admin options.

New in version 7.0: uac-uiaccess option.