.. _script:

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:: --version

   show version number and exit

.. option:: -h, --help

   show this help message and exit

.. option:: -O

    optimize generated bytecode as per PYTHONOPTIMIZE; use -OO in order to
    remove doc strings

.. option:: -c, --compress

    compress byte code in zip files

.. option:: -s, --silent

    suppress all output except warnings and errors

.. option:: --base-name=NAME

    file on which to base the target file; if the name of
    the file is not an absolute file name, the
    subdirectory bases (rooted in the directory in which
    the freezer is found) will be searched for a file
    matching the name

.. option:: --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

.. option:: --target-dir=DIR, --install-dir=DIR

    The directory in which to place the target file and any dependent files

.. option:: --target-name=NAME

    the name of the file to create instead of the base
    name of the script and the extension of the base binary

.. option:: --default-path=DIRS

   list of paths separated by the standard path separator
   for the platform which will be used to initialize
   sys.path prior to running the module finder

.. option:: --include-path=DIRS

    list of paths separated by the standard path separator
    for the platform which will be used to modify sys.path
    prior to running the module finder

.. option:: --replace-paths=DIRECTIVES

    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
    and each value is of the form path=replacement_string;
    path can be * which means all paths not already
    specified

.. option:: --include-modules=NAMES

    comma separated list of modules to include

.. option:: --exclude-modules=NAMES

    comma separated list of modules to exclude

.. option:: --include-files=FILES

    comma separated list of paths to include

.. option:: -z SPEC, --zip-include=SPEC

    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

.. option:: --icon=ICON

   name of the icon file for the application
