Skip to content

Instantly share code, notes, and snippets.

@devsnd
Created May 23, 2018 14:16
Show Gist options
  • Save devsnd/7809a958a3549a374a0ab793c86e2619 to your computer and use it in GitHub Desktop.
Save devsnd/7809a958a3549a374a0ab793c86e2619 to your computer and use it in GitHub Desktop.
from cx_Freeze import setup, Executable
# Dependencies are automatically detected, but it might need
# fine tuning.
buildOptions = {
'packages': [],
'excludes': [
# remove unneeded parts of the standard lib
'unicodedata',
'pydoc',
'distutils',
'email',
'pyreadline',
'difflib',
'doctest',
'locale',
'optparse',
'argparse',
'pickle',
'calendar',
'tkinter',
'_ssl',
],
'optimize': 2,
# https://stackoverflow.com/a/44429619/1191373
"zip_include_packages": "*",
"zip_exclude_packages": ""
}
base = 'Console'
executables = [
Executable('your_python_script.py', base=base)
]
setup(
name='yourProjectName',
version='1.0',
description='Description',
options={'build_exe': buildOptions},
executables=executables
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment