Skip to Content
Python GUI Programming with Tkinter
book

Python GUI Programming with Tkinter

by Alan D. Moore
May 2018
Beginner to intermediate content levelBeginner to intermediate
452 pages
11h 26m
English
Packt Publishing
Content preview from Python GUI Programming with Tkinter

Moving the views

Next, we need to create the views.py file. Views are larger GUI components, like our DataRecordForm class. Currently it's our only view, but we'll be creating more views in later chapters, and they'll be added here.

Open the views.py file and copy in the DataRecordForm class, then go back to the top to deal with the module imports. Again, we'll need tkinter and ttk, and our file saving logic relies on datetime for the filename.

Add them to the top of the file as follows:

import tkinter as tk
from tkinter import ttk
from datetime import datetime

We aren't done, though; our actual widgets aren't here and we'll need to import them. Since we're going to be doing a lot of importing of objects between our files, let's pause for ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Python GUI Programming with Tkinter - Second Edition

Python GUI Programming with Tkinter - Second Edition

Alan D. Moore

Publisher Resources

ISBN: 9781788835886Supplemental Content