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

macOS

When packaging for macOS, cx_freeze may work for you. However, there is another alternative named py2app, which we will take a look at now.

Ensure you have the tkedit.py file described in the Windows section earlier, then install py2app into our virtual environment using pip. We will need version 0.13, since later versions do not support Tkinter properly:

$ source env/bin/activate$ pip install py2app==0.13

With py2app installed, you can go ahead and let it generate a setup.py file using its setup tools:

$ py2applet --make-setup tkedit.py

This should overwrite your setup.py file with a new one. We will need to add our PyYAML dependency to it, so it looks like so:

"""This is a setup.py script generated by py2appletUsage: python setup.py ...

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