O'Reilly logo

Tkinter GUI Programming by Example by David Love

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Windows

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 = [ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required