Using cx_Freeze¶
There are three different ways to use cx_Freeze:
Create a pyproject.toml project file where you can specify extra options, and use the included cxfreeze script. It is also useful when you want to use only the command line.
Create a setup script. This is useful if you need extra options programmatically when freezing your program because you can save them in the script. Run
cxfreeze-quickstartto generate a simple setup script.Work directly with the classes and modules used internally by cx_Freeze. This should be reserved for complicated scripts or extending or embedding. (Not covered in this documentation).
cx_Freeze normally produces a folder containing an executable file for your program and the shared libraries (DLLs or .so files) needed to run it.
cx_Freeze 7.0, introduced the bdist_appimage command for Linux, which supports building in such a way that all the libraries of your application are incorporated into a single executable file.
You can make a simple Windows installer using a setup script with the bdist_msi option, or a macOS disk image with bdist_dmg. For a more advanced Windows installer, use a separate tool like Inno Setup to package the files that cx_Freeze collects.
Python modules for your executables are stored in a zip file. Packages are stored in the file system by default but can also be included in the zip file.