How to do it...

Let's examine this recipe in detail.

In Python GUI programming, one of the first things that can go wrong is missing out on importing required modules.

Here is a simple example:

  1. Open GUI.py and comment out the import statement, # import tkinter as tk.
  2. Run the code and observe the following output:
  1. Add the import statement to the top to solve this error as follows:
#====================== # imports #====================== import tkinter as tk

Using an example from Chapter 7, Storing Data in Our MySQL Database via Our GUI, let's say we click on the Get Quotes button and this works, but we never clicked on the Mody Quote ...

Get Python GUI Programming Cookbook - 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.