Finally, let's create our controller class, Application, by following these steps:
- Open the application.py file and copy in the Application class definition from the script.
- The first thing we'll fix is our imports. At the top of the file, add the following code:
import tkinter as tk from tkinter import ttk from datetime import datetime from . import views as v from . import models as m
We need tkinter and ttk, of course, and datetime to define our filename. Although we only need one class each from views and models, we're going to keep them in their own namespaces anyway. It's likely we're going to have many more views as the application expands, and possibly more models.
- We need to update the call to ...