O'Reilly logo

Tkinter GUI Application Development Blueprints - Second Edition by Bhaskar Chaudhary

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Setting up the GUI in OOP

The text editor we developed in the previous chapter was implemented in procedural code. Although it offered some benefits for quick coding, it had some typical limitations:

  • We started encountering global variables
  • The function definitions needed to be defined above the code that called them
  • Most importantly, the code was not reusable

Therefore, we need some way to ensure that our code is reusable. This is why programmers prefer to use object-oriented programming (OOP) to organize their code into classes.

OOP is a programming paradigm that shifts the focus onto the objects we want to manipulate rather than the logic required to manipulate them. This is in contrast to procedural programming, which views a program ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required