Using Tkinter to create graphical user interfaces
We will create a small GUI to allow the user to enter information, and the program can then be used to encrypt and decrypt it.
Getting ready
You will need to ensure that you have completed the instructions in the There's moreā¦ section of the Working with text and strings recipe in Chapter 2, Starting with Python Strings, Files, and Menus, where we created the reusable encryptdecrypt.py
module. You must ensure that this file is placed in the same directory as the following script.
Note
Since we are using Tkinter (one of many available add-ons of 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 Ctrl + Z to exit the Python...