It is difficult to build large applications if all the code is contained in a single class. By splitting the GUI code into specific classes, we can modularize the structure of our program and create widgets with well-defined purposes.
Composing widgets to display information
Getting ready
Apart from importing the Tkinter package, we will import the Contact class from the preceding recipe:
import tkinter as tk
import tkinter.messagebox as mb
from chapter5_01 import Contact
Verify that the chapter5_01.py file is in the same directory; otherwise, this import-from statement will raise ImportError.