Building macOS application bundles

The bdist_mac build type creates an application bundle, a specially formatted directory with an .app extension that the Macintosh desktop treats as though it were an executable file.

bdist_mac has several configuration options, but we're only going to use two as follows:

cx.setup(    #...    options={
        ...
        'bdist_mac': {
            'bundle_name': 'ABQ-Data-Entry',
            'iconfile': 'abq.icns'
        }

Here, bundle_name sets the name of our application bundle. Normally, this would default to your project's name, but we're overriding it to use dashes instead of underscores. Note that using spaces in this value creates problems for cx_Freeze and is best avoided. The iconfile setting allows us to point to an ICNS file that macOS will use ...

Get Python GUI Programming with Tkinter now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.