Non-Python files
In a PyQt program, the best way to deal with files such as our X and O images is to use the pyrcc5 tool to generate a resources file that can then be added to your module like any other Python file (we learned about this in Chapter 6, Styling Qt Applications). However, in this case, we're going to keep our images as PNG files so that we can explore our options for dealing with non-Python files.
There is little consensus on where these kinds of files should live inside a project directory, but since these images are a required component of the TTTBoard class, it makes sense to put them inside our module. For the sake of organization, put them in a directory called images.
Your directory structure should now look like this: ...
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