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

Program structure and broadview skeleton

Our first goal is to build the broad modular structure for the program. As usual, we will keep the data structure, audio-related logic, and the presentation logic in three separate files. Therefore, we will create three separate files named model.pyplayer.py, and view.py (see code 5.01).

Let's create an empty Model class and an empty Player class in their respective files. The following is the code for 5.01model.py:

class Model:  def __init__(self):    pass

Here's the code for 5.01player.py:

import pygletclass Player():  def __init__(self):    pass

Next, let's create the View class. We will leave the Model and Player classes empty for now. However, we will complete this iteration by coding the majority ...

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