Getting ready

You must ensure that this file is placed in the same directory.

Since we are using Tkinter (one of many available add-ons for Python), we need to ensure that it is installed. It should be installed by default on the standard Raspbian image. We can confirm it is installed by importing it from the Python prompt, as follows:    Python3    >>> import tkinter If it is not installed, an ImportError exception will be raised, in which case you can install it using the following command (use CtrlZ to exit the Python prompt):    sudo apt-get install python3-tk If the module did load, you can use the following command to read more about the module (use Q to quit when you are done reading):    >>>help(tkinter) You can also get ...

Get Raspberry Pi 3 Cookbook for Python Programmers - Third Edition 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.