April 2018
Beginner
340 pages
7h 54m
English
To package our text editor for Windows, we will need to use a module known as cx_freeze. This module is installed using pip via pip install cx_freeze.
To tell cx_freeze about our application, we will need to adjust our setup.py file:
from cx_Freeze import setup, Executableimport sysbase = 'Win32GUI' if sys.platform=='win32' else Noneimport osPYTHON_INSTALL_DIR = os.path.dirname(os.path.dirname(os.__file__))os.environ['TCL_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tcl8.6')os.environ['TK_LIBRARY'] = os.path.join(PYTHON_INSTALL_DIR, 'tcl', 'tk8.6')options = { 'build_exe': { 'include_files':[ os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tk86t.dll'), os.path.join(PYTHON_INSTALL_DIR, 'DLLs', 'tcl86t.dll'), ], },}executables = [ ...