4

Organizing Our Code with Classes

Things are going great with your data entry form! Your boss and coworkers and excited to see the progress you've made and are already coming up with some ideas of what other features could be added. This makes you a little nervous, to be honest! While they see a professional-looking form, you know that the code underneath is getting bulky and repetitive. You've got some warts in there too, like a global variable and a very cluttered global namespace. Before you start adding more features, you'd like to get a handle on this code and start breaking it down into some manageable chunks. For this, you'll need to create classes.

In this chapter, we'll cover the following topics:

  • In A primer on Python classes, we'll ...

Get Python GUI Programming with Tkinter - Second 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.