Module-style structure
As programmers, we tend to think of applications and libraries as two very different things, but, in truth, well-structured applications aren't that different from libraries. A library is just a collection of ready-made classes and functions. Our application is mostly just class definitions as well; it just happens to have a few lines of code at the end that allow it to be executed as an application. When we see things this way, structuring our application as a Python library module makes a lot of sense. To do this, we're going to convert our single Python file to a directory full of files, each containing an individual unit of code.
The first step is to consider our project's name; right now, that name is ttt-qt.py ...
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.
Read now
Unlock full access